Link to home
Start Free TrialLog in
Avatar of picsnet
picsnet

asked on

Asp.Net Menu Querystring in navigateurl causes error

<asp:MenuItem Text="Support" NavigateUrl="~/Support.aspx?product=fundtrackersql"></asp:MenuItem>
Message = "'~/Support.aspx?product=fundtrackersql' is not a valid virtual path."

Any Ideas??

Tony
ASKER CERTIFIED SOLUTION
Avatar of jeebukarthikeyan
jeebukarthikeyan
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of picsnet
picsnet

ASKER

I know what is happening.  I just now need a way to fix it.  It is only crashing when the method below occurs.  I call this in the masterpage page_load and it highlights the current page you are on in the menu in a special way.  I think I just need to strip out the querystring.  

Tony

  Public Sub SelectMenuItem(ByVal Items As MenuItemCollection)

    For Each objItem As MenuItem In Items

      If _FoundSelected Then Exit Sub

      If Page.Request.PhysicalPath.ToLower() = Page.MapPath(objItem.NavigateUrl).ToLower() Then
        objItem.Selected = True
        _FoundSelected = True
      Else
        objItem.Selected = False
      End If

      If objItem.ChildItems.Count > 0 Then
        SelectMenuItem(objItem.ChildItems)
      End If

    Next

  End Sub
Avatar of YZlat
try

<asp:MenuItem Text="Support" NavigateUrl="Support.aspx?product=fundtrackersql"></asp:MenuItem>