>>How to write Mutileple else if with databinder in asp.net ?
Ans) for a singel if else statement its prity straight forward
<%# (DataBinder.Eval(Container.DataItem, "ColomnName").ToString()=="abcd") ? "true": "false"%>
for multiple just use this :
<%#(DataBinder.Eval(Container.DataItem, "ModuleName").ToString()=="abcd") ? "yes its abcd" :
((DataBinder.Eval(Container.DataItem, "ModuleName").ToString()=="efgh") ? "yes its efgh" : "no its not abcd or efgh"))%>
No comments:
Post a Comment