HyperLink trouble

  • Thread starter Thread starter Jeff
  • Start date Start date
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?
 
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.
 
Back
Top