Hi guys,
wanna ask you for help. I am bit lost with declarative statement in asp.net 2.0.
I want add specific class "selected" or "noselected" for A tag when current path is equal to path I provide. I tried st., but it is not working. The code is below:
<a href="<%# DataBinder.Eval(Container.DataItem, "Url") %>" class="<%# (DataBinder.Eval(Container.DataItem, "Url").ToString().Equals(Request.RawUrl))?"selected":"notselected" %>">linkname</a>
the value of "Url" is "/SubDir/SecondPage.aspx"
I am not sure if short "IF" statment works and if I compare right values of urls. If you see guys something significant, would be great.
Thanks. X.
[EDIT] OK, the code above is completely fine, no need to change it. the problem was in me.Beat me.