Subject: Asp : Menu Control
Posted By: sofia Post Date: 11/28/2006 1:10:01 AM
hi i have used asp:Menu control in my master page and sitemap for datasource.Depending on the menu item clicked corresponding page loads. I changed the style of the selected menu item using StaticSelectedStyle attribute.But when i click on any button on that content page which loads another page the menu item style is changing to StaticMenuItemStyle. I want to show the style as StaticSelectedStyle.Kindly please help me..

Reply By: thenoseknows Reply Date: 11/28/2006 5:19:51 PM
Well, I doubt this is the most efficient way, but in your code behind, you can check the Request.RawUrl, and compare it to  each treeview nodes NavigateUrl property one by one. Where they match, you set the nodes selected property to true...if anyone knows a more efficient way  where you don't have to iterate through the nodes array, let me know!



Protected Sub trVw_DataBind(ByVal sender As Object, ByVal e As EventArgs) Handles trVw.DataBound

        For Each treeVwNode As TreeNode In trVw.Nodes

            If (treeVwNode.NavigateUrl = Request.RawUrl) Then
                treeVwNode.Selected = True
            End If

        Next

    End Sub



Neil Timmerman
Programmer
Veris Consulting

Go to topic 52426

Return to index page 108
Return to index page 107
Return to index page 106
Return to index page 105
Return to index page 104
Return to index page 103
Return to index page 102
Return to index page 101
Return to index page 100
Return to index page 99