ResolveClientUrl in markup for hyperlink

In my master page I have a menu that is used on all pages within the website. When I click "Home" I want it to go to default.aspx in the root. Many of these pages are in subdirectories. So, I am using ResolveClientUrl for this. But this does not work.

<asp:HyperLink ID="HyperLink6" runat="server" NavigateUrl='<% =ResolveClientUrl("./default.aspx") %>'>HOME</asp:HyperLink>

Any ideas?
LVL 9
RobertNZanaAsked:
Who is Participating?
 
Paul JacksonSoftware EngineerCommented:
try
<asp:HyperLink ID="HyperLink6" runat="server" NavigateUrl="~/default.aspx">HOME</asp:HyperLink>
0
 
RobertNZanaAuthor Commented:
This is the url it navigates to...

http://localhost:4126/mywebsite/%3C%%20=ResolveClientUrl%28%22./default.aspx%22%29%20%%3E

The page says...

Server Error in '/mywebsite' Application.
HTTP Error 400 - Bad Request.
Version Information: ASP.NET Development Server 9.0.0.0
0
 
RobertNZanaAuthor Commented:
For some reason AutoEventWireup="false" was missing. I added that and it worked. Thanks.
0
 
RobertNZanaAuthor Commented:
AutoEventWireup="false" was missing. But jacko72's comment was useful. Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.