Solved

ResolveClientUrl in markup for hyperlink

Posted on 2011-03-24
4
1,182 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 Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

679 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