newbie: trouble with asp:HyperLink

J

Jeff

hey

asp.net 2.0

I have a asp:HyperLink on a usercontrol. If I set it's NavigateUrl to
something like www.helloworld.com, and click on the link during runtime,
then the link don't navigate to this page. Instead it navigate to
http://localhost:1794/Test/Controls/www.helloworld.com

http://localhost:1794/Test/Controls/ is the folder in which I've placed the
usercontrol using this hyperlink

This is the markup of my HyperLink
<asp:HyperLink ID="hlCompany" runat="server" CssClass="label"
Target="_blank" Width="175px">[hlCompany]</asp:HyperLink><br />

Any suggestions?

Jeff
 
M

Mark Fitzpatrick

Jeff,
You have to preface an external URL with http://. The control won't do
it for you as it can't tell if you're looking to browser to a local page or
want to browse to an external site.
 
J

Jeff

okay, thanks



Steve C. Orr said:
I suggest you set the hyperlink's NavigateURL to this:
http://www.helloworld.com

That way it doesn't think its a relative URL since you seem to be linking
to an external site.

--
I hope this helps,
Steve C. Orr
MCSD, MVP, CSM
http://SteveOrr.net


Jeff said:
hey

asp.net 2.0

I have a asp:HyperLink on a usercontrol. If I set it's NavigateUrl to
something like www.helloworld.com, and click on the link during runtime,
then the link don't navigate to this page. Instead it navigate to
http://localhost:1794/Test/Controls/www.helloworld.com

http://localhost:1794/Test/Controls/ is the folder in which I've placed
the usercontrol using this hyperlink

This is the markup of my HyperLink
<asp:HyperLink ID="hlCompany" runat="server" CssClass="label"
Target="_blank" Width="175px">[hlCompany]</asp:HyperLink><br />

Any suggestions?

Jeff
 
B

Boris Twila

yes, it can tell if you're looking to browser to a local page or
want to browse to an external site.

You are telling you want to browse to a local page
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top