This is a migrated thread and some comments may be shown as answers.

RadMenu and DB Navigation

1 Answer 60 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Chase Florell
Top achievements
Rank 1
Chase Florell asked on 09 Sep 2008, 04:40 PM
This seems like a simple problem but I am not getting it.

I need my menu to bind to a DB and navigate as follows.

www.mysite.com/Default.aspx?ID=[DatabaseID]

If I use
RadMenu1.DataNavigateUrlField = "ID"
Then it navigates as follows
www.mysite.com/[DatabaseID]

If I use
RadMenu1.PostBackURL = "Default.aspx?ID="
Then I dont get the ID at the end... Where have I gone wrong?

    Private Sub RenderMenu()  
        If Not Page.IsPostBack Then 
 
            Dim PagesDC As New Dal.icms_PagesDataContext()  
            Dim results = From r In PagesDC.icms_Pages_GetPageMenu _  
                          Select r  
 
            RadMenu1.DataTextField = "MenuName" 
            RadMenu1.DataFieldID = "ID" 
            RadMenu1.DataFieldParentID = "ParentID" 
            RadMenu1.DataNavigateUrlField = "" 
 
            RadMenu1.DataSource = results  
            RadMenu1.DataBind()  
 
        End If 
    End Sub 

1 Answer, 1 is accepted

Sort by
0
Chase Florell
Top achievements
Rank 1
answered on 09 Sep 2008, 05:20 PM
Evidently this is the way to do the above mentioned.

    Private Sub RenderMenu()  
        If Not Page.IsPostBack Then 
 
            Dim PagesDC As New Dal.icms_PagesDataContext()  
            Dim results = PagesDC.icms_Pages_GetPageMenu()  
 
            RadMenu1.DataTextField = "MenuName" 
            RadMenu1.DataFieldID = "ID" 
            RadMenu1.DataFieldParentID = "ParentID" 
 
            RadMenu1.DataSource = results  
            RadMenu1.DataBind()  
 
        End If 
    End Sub 
 
    Protected Sub RadMenu1_ItemDataBound(ByVal sender As ObjectByVal e As Telerik.Web.UI.RadMenuEventArgs) Handles RadMenu1.ItemDataBound  
        e.Item.NavigateUrl = "~/Default.aspx?ID=" & CType(DataBinder.Eval(e.Item.DataItem, "ID"), String).ToString  
    End Sub 
Tags
Menu
Asked by
Chase Florell
Top achievements
Rank 1
Answers by
Chase Florell
Top achievements
Rank 1
Share this question
or