Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > asp:hyperlink - NavigateURL is always relative. I need absolute.

Reply
Thread Tools

asp:hyperlink - NavigateURL is always relative. I need absolute.

 
 
Carl Grainger
Guest
Posts: n/a
 
      09-24-2006
Hi, When progammatically setting the navigateURL property in code behind, the
URL is always rendered as relative i.e it's appended to the applications root
URL. If I use the same string and hard code it the URL is rendered correctly
as absolute.

Can anyone tell me how to set an abolute URL in code behind. I'm using
ASP.NET 2.0/VB/VS 2005. The URL I'm passing is "http://www.mywebsite.com/"
etc.

Appreciate any help - faster the better. More info if required. Regards Carl
Grainger

 
Reply With Quote
 
 
 
 
Carl Grainger
Guest
Posts: n/a
 
      09-25-2006
Sorted after some trial and error: I was using stringbuilder.append and then
toString to build the navigateURL. I was then using server.URLencodie to
remove spaces in one of the querystrings etc. I didn't know that the
stringbuilder was already doing this step for me. By using both the
navigateURL was appended to the application root. Hope this helps someone
else.

"Carl Grainger" wrote:

> Hi, When progammatically setting the navigateURL property in code behind, the
> URL is always rendered as relative i.e it's appended to the applications root
> URL. If I use the same string and hard code it the URL is rendered correctly
> as absolute.
>
> Can anyone tell me how to set an abolute URL in code behind. I'm using
> ASP.NET 2.0/VB/VS 2005. The URL I'm passing is "http://www.mywebsite.com/"
> etc.
>
> Appreciate any help - faster the better. More info if required. Regards Carl
> Grainger
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HyperLink.NavigateUrl always adds an extra ../ when going to a higher level directory Nathan Sokalski ASP .Net 0 05-29-2005 11:33 PM
HyperLink.NavigateUrl always adds an extra ../ when going to a higher level directory Nathan Sokalski ASP .Net Web Controls 0 05-29-2005 11:33 PM
Trying to create a CSS box that is always is always the width of an image placed inside it (and no wider) Deryck HTML 4 06-22-2004 08:25 PM
undesired behavior in setting hyperlink .NavigateURL property Boban Dragojlovic ASP .Net 3 10-29-2003 09:05 PM
NavigateUrl problem Helixpoint ASP .Net 0 07-22-2003 05:42 PM



Advertisments