Imports EDSL.Entities
Imports EDSL.DAL
Public Partial Class BreadCrumb
  Inherits System.Web.UI.UserControl
  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim strLinkPath As String = "<a href=""" & ConfigurationManager.AppSettings("AdminURL") & "categoryadmin/list.aspx?cid="
    Dim booContinue As Boolean = True
    Dim strBreadCrumbcode As string = ""
    Dim strSearchingForCID As String = Request.QueryString("cid")
    Dim strReturnedCID As String = ""
    Dim strReturnedCTitle As String = ""

    Do While booContinue = True
      Dim objMain As New dbMainCategory
      Dim objMainEntity As entmainCategory = objMain.GetItem(strSearchingForCID)

      strReturnedCID = objMainEntity.ParentCategoryID
      strReturnedCTitle = objMainEntity.CategoryName

      If strReturnedCTitle is Nothing then
        booContinue = False
      Else
        strBreadCrumbcode = strLinkPath & strSearchingForCID & """ class=""lnkCategoryBase"">" & strReturnedCTitle & "</a><span class=""breadseperator""> > </span>" & strBreadCrumbcode
        strSearchingForCID = strReturnedCID
      End If
    Loop
    divBreadCrumb.InnerHtml = strBreadCrumbcode
  End Sub
End Class