Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, first the background: I hav

Status
Not open for further replies.

pdtt

Programmer
Sep 24, 2002
35
CA
Hi,

first the background: I have my navigation HTML control hyperlinks in a User Control which is loaded onto my page (it is actually using a template). The Application start page is MyApp/Default.aspx. A user is redirected to a sub directory Default.aspx page upon authentication.
In this case MyApp/Admin/Default.aspx.

MyApp/Admin/Default.aspx is the controller for all "pages" in the Admin web application. All links on the MyAppAdmin/Default.aspx link back to MyAppAdmin/Default.aspx with a param to tell the Default.aspx which control to put into it's main body placeholder. Then the MyApp/Admin/Default.aspx is served back to the browser with the new content in the body.

The Problem:

The first time the MyApp/Admin/Default.aspx is rendered to the Browser, the link urls are correct for example: "On the anchor, the href coded as "Admin/Default.aspx?pageid=2".

Clicking on the link takes me back to MyApp/Admin/Default.aspx correctly and the pageid=2 content is loaded in. However, once reloaded,if I now look at the properties of the hyperlink the href is now " It has added my href on to the now virtual location?

I have tried different combinations in the href. I have also tried programatically to override the setting in the code-behind.Page_Load method of the Navigation control. It didn't have any affect.

Question:

How do I set up my href so that it doesn't add the extra directory on to the URL?
Or, at what point does ASP.NET / IIS put add the virtual path to the href property? and can
I override the value in a method other than Page_Load?

Thanks for any help,
 
Figured it out with some help with someone in another Forum.
I just had to collect the BaseURL in a string, concatenate it to the sub-directory in the code-behind file.Then just use the resulting string value in the aspx when I set the href url.

<A href=&quot;<%=strPageDirectory%>Default.aspx?pageid=1&quot; id=&quot;hrefHomePage&quot;>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top