Refactor aspx page using Eval and If Statement C#

Manishz

New Member
I was wonder if there is a better way of writing this code.\[code\]<%#Eval("hasAccess").Equals(true) ? "<a href='http://stackoverflow.com/CaseActivities.aspx?" + Eval("caseURL") + "'>" + Eval("caseName") + "</a>" : Eval("caseName")%> \[/code\]I tried <% If (Eval("hasAccess") ... but asp.net doesnt like that :)I was hoping for something like\[code\]<% If Eval("hasAccess") %>do stuff .. <% else %>do other stuff.\[/code\]But when using the Eval with IF it get messy .. any thoughts?
 
Back
Top