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

C

Carl Grainger

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
 
C

Carl Grainger

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top