Solved

ResolveClientUrl in markup for hyperlink

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
convert html to string 6 34
How to close an asp.net web form using C# ? 4 30
performance issue in asp web 5 28
How come this regular expression allows "e"? 14 35
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
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.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

785 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