Okay so I have this breadcrumb for VB Script. When the user hits back it will take them to the previous crumb id. What Im trying to do is when they hit that back button it takes out the last crumb/id out of it completely so when they go forward again to a different area the previous spot is no longer there. Any help would be great thanks. Here is my code.
<%
'Function for creation of breadcumb trails
Public Function BuildCrumb(Title)
Response.CacheControl = "no-cache"
Dim Separator
Separator = " | "
Dim GetPage
GetPage = Split(Request.ServerVariables("PATH_INFO"), "/")
Dim PageLink
For Each var In Request.Querystring
PageLink = "<a href=" & GetPage(Ubound(GetPage)) & "?" & var & "=" & Request.Querystring(var)
Next
Set var = Nothing
If PageLink = "" then
PageLink = "<a href=" & GetPage(Ubound(GetPage)) & " class=crumb>" & Title & "</a>"
Else
PageLink = PageLink & " class=crumb>" & Title & "</a>"
End If
If Request.Cookies("Crumb") <> "" Then
Dim GetCurrentPageTitle
GetCurrentPageTitle = Split(Request.Cookies("Crumb"), " | ")
If InStr(Request.Cookies("Crumb"), PageLink) = 0 then
Response.Cookies("Crumb") = Request.Cookies("Crumb") & Separator & PageLink
Else
For i = 0 To UBound(GetCurrentPageTitle)
If PageLink <> Trim(GetCurrentPageTitle(i)) Then
Crumb = Crumb & Trim(GetCurrentPageTitle(i)) & Separator
Else
i = UBound(GetCurrentPageTitle)
End If
Next
Response.Cookies("Crumb") = ""
Response.Cookies("Crumb") = Crumb & PageLink
Set Crumb = Nothing
Set i = Nothing
End If
Else
Response.Cookies("Crumb") = "<a href=MDCLibrary.asp class=crumb>MDC Library Home</a>" & Separator & PageLink
End If
Response.Cookies("Crumb").Expires = Dateadd("d", 1, Date)
Set GetCurrentPageTitle = Nothing
Set PageLink = Nothing
Set GetPage = Nothing
Set Separator = Nothing
End Function
'Reset the breacrumb trail to start another
Public Function RestartCrumb()
Response.Cookies("Crumb") = ""
End Function
%>
<%
'Function for creation of breadcumb trails
Public Function BuildCrumb(Title)
Response.CacheControl = "no-cache"
Dim Separator
Separator = " | "
Dim GetPage
GetPage = Split(Request.ServerVariables("PATH_INFO"), "/")
Dim PageLink
For Each var In Request.Querystring
PageLink = "<a href=" & GetPage(Ubound(GetPage)) & "?" & var & "=" & Request.Querystring(var)
Next
Set var = Nothing
If PageLink = "" then
PageLink = "<a href=" & GetPage(Ubound(GetPage)) & " class=crumb>" & Title & "</a>"
Else
PageLink = PageLink & " class=crumb>" & Title & "</a>"
End If
If Request.Cookies("Crumb") <> "" Then
Dim GetCurrentPageTitle
GetCurrentPageTitle = Split(Request.Cookies("Crumb"), " | ")
If InStr(Request.Cookies("Crumb"), PageLink) = 0 then
Response.Cookies("Crumb") = Request.Cookies("Crumb") & Separator & PageLink
Else
For i = 0 To UBound(GetCurrentPageTitle)
If PageLink <> Trim(GetCurrentPageTitle(i)) Then
Crumb = Crumb & Trim(GetCurrentPageTitle(i)) & Separator
Else
i = UBound(GetCurrentPageTitle)
End If
Next
Response.Cookies("Crumb") = ""
Response.Cookies("Crumb") = Crumb & PageLink
Set Crumb = Nothing
Set i = Nothing
End If
Else
Response.Cookies("Crumb") = "<a href=MDCLibrary.asp class=crumb>MDC Library Home</a>" & Separator & PageLink
End If
Response.Cookies("Crumb").Expires = Dateadd("d", 1, Date)
Set GetCurrentPageTitle = Nothing
Set PageLink = Nothing
Set GetPage = Nothing
Set Separator = Nothing
End Function
'Reset the breacrumb trail to start another
Public Function RestartCrumb()
Response.Cookies("Crumb") = ""
End Function
%>