Website URL not creating in correct format
I am developing a page in asp.net with c#. On this page I have a grid view control which showing customer name and its website. The problem is that when i click on this website address then the URL so created is not in the correct format.
For example, if my customer name is Yahoo and its website address is www.yahoo.com. Then on clicking the website link error will occurred.
My code on aspx page:
<asp:TemplateField>
<ItemTemplate>
<asp:HyperLink ID="linkWebsite" runat="server" Text='<%#Eval("Website") %>'
NavigateUrl='<%# Eval("Website") %>' />
</ItemTemplate>
</asp:TemplateField>
My page URL is: http开发者_StackOverflow社区://localhost:4294/ReadyToCode/Admin/ManageCustomer.aspx
then the website URL will become http://localhost:4294/ReadyToCode/Admin/www.yahoo.com
how to get only www.yahoo.com ?
Please help me...
Try,
NavigateUrl='<%# Eval("Website","http://{0}") %>'
精彩评论