skendrick
Technical User
- Mar 31, 2003
- 34
Is it possible to do an If then Statement and show something only if the DataBinder.Eval has info in it? What I am trying to achive is by having a client name in a list with a hyperlink so that you can click the name and go to their website. Or if the client doesn't have a link then it will just display the name and if you try to click it then it doesn't click since it's not a hyperlink. I have used a data reader and binded the data and used the asp repeater control to repeat the clients in the database. That works fine.
Now how this works is if the client has a link it will work. If no link then it will just give you I have to add http:// because in the database it's just the domain name with out the http://
I am new to asp.net only used it for about a week now. I have gotten everything else to work just getting this to work is my problem now. Does any one have any ideas?
Thanks in advance
Sterling
Code:
<alternatingitemtemplate>
<a href="[URL unfurl="true"]http://<%#[/URL] DataBinder.Eval(Container.DataItem, "client_Website") %>" target="_blank"><%# DataBinder.Eval(Container.DataItem, "client_Name") %></a><br>
<%# DataBinder.Eval(Container.DataItem, "client_Comment") %>
</alternatingitemtemplate>
Now how this works is if the client has a link it will work. If no link then it will just give you I have to add http:// because in the database it's just the domain name with out the http://
I am new to asp.net only used it for about a week now. I have gotten everything else to work just getting this to work is my problem now. Does any one have any ideas?
Thanks in advance
Sterling