I have a control on one of my page which takes some user input (URL) and allows the user to test the link.
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("URL") %>' Target="_blank">Click here to test link</asp:HyperLink>
The problem is if the user puts in the URL “google.com”, then the link will be treated as “http://localhost/google.com”. I have to put “http://www.google.com” for it to go to the right place.
Is it possible to treat the link like it is an absolute link in all cases?
Try this…
Edit: if you want to add check whether it already contain
http://then it should be like..