Solved

Asp.Net Menu Querystring in navigateurl causes error

Posted on 2007-04-11
3
1,451 Views
Last Modified: 2013-11-07
<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
0
Comment
Question by:picsnet
3 Comments
 
LVL 13

Accepted Solution

by:
jeebukarthikeyan earned 500 total points
ID: 18892973
hi,

have a look at this

<asp:Menu ID="Menu1" runat="server">
<Items>
<asp:MenuItem Text="buddha" Value="jeebu" NavigateUrl="~/FormControls/clipboard.aspx?id=dd"></asp:MenuItem>
</Items>
</asp:Menu>

i think in ur code the path specifies is not correct

b u d d h a
0
 
LVL 1

Author Comment

by:picsnet
ID: 18893133
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
0
 
LVL 35

Expert Comment

by:YZlat
ID: 18893198
try

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

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question