Solved

Asp.Net Menu Querystring in navigateurl causes error

Posted on 2007-04-11
3
1,457 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

705 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