I am trying to make my site fully AJAXified while still updating the querystring for search engine optimization purposes.
Here is what I am trying
ASPX.VB
ASPX
The plan is to update the HiddenID via javascript and using RadAJAX in the RadMenu1_ItemClick event to poll the database and update an asp: Panel with the new DB information.
anyone have any thoughts?
Here is what I am trying
ASPX.VB
| Private Sub RenderMenu() |
| AddStyleSheet("~/RadControls_CustomSkin/Menu.RadControls_CustomSkin.css") |
| Dim PagesDC As New Dal.icms_PagesDataContext() |
| Dim results = PagesDC.icms_Pages_GetPageMenu() |
| RadMenu1.Skin = "RadControls_CustomSkin" |
| RadMenu1.DataTextField = "MenuName" |
| RadMenu1.DataFieldID = "ID" |
| RadMenu1.DataFieldParentID = "ParentID" |
| RadMenu1.EnableEmbeddedSkins = False |
| RadMenu1.OnClientItemClicked = "SetID()" |
| RadMenu1.DataSource = results |
| RadMenu1.DataBind() |
| End Sub |
| Protected Sub RadMenu1_ItemClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadMenuEventArgs) Handles RadMenu1.ItemClick |
| Dim HiddenID As HiddenField = DirectCast(Me.FindControl("HiddenID"), HiddenField) |
| End Sub 'RenderMenu |
| Protected Sub RadMenu1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadMenuEventArgs) Handles RadMenu1.ItemDataBound |
| e.Item.NavigateUrl = "#ID=" & CType(DataBinder.Eval(e.Item.DataItem, "ID"), String) |
| End Sub 'RadMenu1_ItemDataBound |
ASPX
| <script type="text/javascript"> |
| function SetID() |
| { |
| document.getElementById('<%= HiddenID.ClientID %>').value = window.location.hash; |
| } |
| </script> |
| <asp:HiddenField ID="HiddenID" runat="server" /> |
The plan is to update the HiddenID via javascript and using RadAJAX in the RadMenu1_ItemClick event to poll the database and update an asp: Panel with the new DB information.
anyone have any thoughts?