Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Asp.Net Menu Querystring in navigateurl causes error

Posted on 2007-04-11
3
Medium Priority
?
1,483 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 2000 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

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Integration Management Part 2
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month20 days, 18 hours left to enroll

810 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