I\'m trying to check a string value inside a repeater, and if it has value then write a link, but can\'t seem to get it to work. If there is a value in myUrl then I want to
I personally hate using conditional logic like that in the page.
There are two options that I think are better. You could have a Hyperlink control in the repeater - and set the visibility depending on if the myURL param is there.
visibility='<% #Eval("myURL").ToString().Length > 0 %>'
OR what you can do is have a method on your code behind that you call back to with the "myURL" param.
E.g.
public string CreateURL(string myURL){
if(!string.IsNullOrEmpty(myURL)){
return "
And call in ASPX
<%# CreateURL(Eval("myURL").ToString()) %>
NB this is untested code but this is the ways I usually do this sort of thing.