The href value of the Html anchor tag is rendering weird

Posted by franko_camron on Stack Overflow See other posts from Stack Overflow or by franko_camron
Published on 2012-09-15T03:28:51Z Indexed on 2012/09/15 3:37 UTC
Read the original article Hit count: 164

Filed under:
|
|
|

I want to assign dynamically the href value depending of certain things, I thing is important to mention that I have a Master Page, url routing and I am assigning absolute paths (like http://www.stackoverflow.com/questions/...).

I've tried the following:

<a href="<%= DynamicURL%>">testing urls</a>
<asp:HyperLink runat="server" ID="hpLink">this teset brouw</asp:HyperLink>

and in code behind

hpLink.NavigateUrl = "http://www.someurl.com/morepath/morethisngs";

I have also tried this

<a runat="server" id="aAccesories">Testing ...</a>

and in code behind I do this:

   aAccesorios.HRef = "http://www.someurl.com/morepath/morethisngs";

what ever I try when I see the html source code the links render like this:

http://localhost:10027/projectTest/\www.someurl.com/morepath/morethisngs

so I cant create absolute paths or absolute URLS, doesnt matter what I tried, this is weird isnt it? i adds the domain to the urls and then it removes the http:// then it adds the path I wanted

hope you can help me, thanks!

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET