HyperLink trouble

J

Jeff

hi

asp.net

I have a GridView which have a templetefield containing a HyperLink, (that
is a server control, not href control).

in the RowDataBound I programmatically add information to that HyperLink:
HyperLink hyperlink = (HyperLink)e.Row.FindControl("Website");
hyperlink.NavigateUrl = company.WebSite;
hyperlink.Text = company.WebSite;
hyperlink.Target = "_blank";

PROBLEM:
When I click on the link the designated target is not shown in the
webbrowser. instead the url is a combination of current url + the url I
specified... Here is the url shown in IE6:
http://localhost:1809/test/www.vg.no

what I do wrong?
 
G

Guest

Seems like I had to add http:// in front of the url to get to work....









- Zitierten Text anzeigen -

Yes, because in other case, browser understands it as a relative URL
and adds current path at the beginning.
 

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,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top