" Text="<%#Eval('name')%>" Target="_blank" runat="server" />
here the text th开发者_C百科at i have binded to navigate url can be any url (eg:asp.net,google.com)
this is my code when i try to open a new iE window
as my file is under an directory admin/abc.aspx
now in the url it opens like this: http://localhost:5655/admin/www.asp.net
but in the url should be like this www.asp.net so that this website opens
any help would be great
thank you
remember to begin your urls with http://
otherwise it will think it's a relative url.
It's pretty simple. Set the "Target" attribute of your asp:HyperLink to "_blank". Fill the url into NavigateUrl. It's going to open the link in a new Browser.
<asp:HyperLink runat="server" ID="lnkUrlValue" NavigateUrl='<%#Eval("Url")%>'
Text='<%#Eval("Url")%>' ForeColor="#8D34FF" Font-Underline="true")
Target="_blank"></asp:HyperLink>
Make sure the URL starts with a protocol like http://
Try the following:
<asp:HyperLink
id="hyperlink1"
NavigateUrl="<%# (Eval("URL").ToString().IndexOf("http://")!=-1 ? "http://":"")+Eval("name").ToString()%>"
Text="<%#Eval('name')%>"
Target="_blank"
runat="server" />
final answer
" Text="<%#Eval('name')%>" Target="_blank" runat="server"/>
NavigateUrl='<%# "http://" + Eval('name')%>'
Did you tried this
NavigateUrl='<%# "http://" + Eval('name')%>'
精彩评论