HI
I have tried several of the ideas in this forum but have not managed to make them work for my case.
I have a panel bar with sub menus, and the cookie is set to retain the sub menu open when navigating to the
pages in the menu.
What is also happening - that I don't want to happen - is that when the visitor closes their browser and then comes back to the site later, the menu is still at the state it was when they left . ie if there was a sub menu open, it is still open.
What I have been trying to do (in the panel bar load event) is detect whether there is null referrer (visiting from a bookmark) or the referrer is not a page on the site, and then clear cookies and close all items
Maybe the referrer information is not even available in this page event. Maybe it can be done in JavaScript after page load?
Thanks
Clive
I have tried several of the ideas in this forum but have not managed to make them work for my case.
I have a panel bar with sub menus, and the cookie is set to retain the sub menu open when navigating to the
pages in the menu.
What is also happening - that I don't want to happen - is that when the visitor closes their browser and then comes back to the site later, the menu is still at the state it was when they left . ie if there was a sub menu open, it is still open.
What I have been trying to do (in the panel bar load event) is detect whether there is null referrer (visiting from a bookmark) or the referrer is not a page on the site, and then clear cookies and close all items
If Request.UrlReferrer IsNot Nothing Then strReferrer = Request.UrlReferrer.GetLeftPart(UriPartial.Authority).ToString() If InStr(strReferrer, "scargillmovement") > 0 Then ' internal referrer do not remove cookie Else 'external referrer so close menu If Page.Request.Cookies("TelerikRadPanelBarCookie") IsNot Nothing Then Page.Request.Cookies("TelerikRadPanelBarCookie").Value = Nothing End If For Each item As RadPanelItem In RadPanelBar1.GetAllItems() If Not item.Items.Count = 0 Then item.Expanded = False End If Next End If Else ' link straight in from bookmark or type in so remove cookie and close menu If Page.Request.Cookies("TelerikRadPanelBarCookie") IsNot Nothing Then Page.Request.Cookies("TelerikRadPanelBarCookie").Value = Nothing End If For Each item As RadPanelItem In RadPanelBar1.GetAllItems() If Not item.Items.Count = 0 Then item.Expanded = False End If Next End IfMaybe the referrer information is not even available in this page event. Maybe it can be done in JavaScript after page load?
Thanks
Clive