IIF binding multiple conditions in ASP.NET gridview item template -
this works:
text='<%# iif(eval("likes") = "0", "n/a", "some text")%>'
this doesn't:
text='<%# iif(eval("likes") = "0", "n/a", iif(eval("likes") = "1", " text", "other text")%>'
i trying add conditional statement asp textbox binding. work 1 condition? or can use "or iif" or that?
yes can chain if condition want. example:
<%# iif(eval("likes") = "0" , eval("likes2") = "0", "n/a", "some text")%>
the first part of iif statement condition , can chain want.
yes did missunderstood answer still yes can it. consider following code:
dim test1 boolean = true dim test2 boolean = false dim test3 string = iif(test2, "true", iif(test1, "true", "false"))
this more like:
if test2 ' code else if test1 ' code end if end if
is wanted or did mean:
if test2 ' code elseif test1 ' code endif
as far know 2nd option cannot done iif statement.
Comments
Post a Comment