Solved

ResolveClientUrl in markup for hyperlink

Posted on 2011-03-24
4
1,142 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

759 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

23 Experts available now in Live!

Get 1:1 Help Now