Solved

ResolveClientUrl in markup for hyperlink

Posted on 2011-03-24
4
1,152 Views
Last Modified: 2012-05-11
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?
0
Comment
Question by:RobertNZana
  • 3
4 Comments
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 250 total points
ID: 35211065
try
<asp:HyperLink ID="HyperLink6" runat="server" NavigateUrl="~/default.aspx">HOME</asp:HyperLink>
0
 
LVL 9

Author Comment

by:RobertNZana
ID: 35211089
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
 
LVL 9

Author Comment

by:RobertNZana
ID: 35211101
For some reason AutoEventWireup="false" was missing. I added that and it worked. Thanks.
0
 
LVL 9

Author Closing Comment

by:RobertNZana
ID: 35211174
AutoEventWireup="false" was missing. But jacko72's comment was useful. Thanks.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

914 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now