Help please - I have a listview looking up integer values from a db, then passes it to the codebehind to check if the db value is 0 - in which case it will display the appropriate message.
It looks something like this: On the aspx page:
<ItemTemplate>
<ul>
<%# List(Eval("p1", "Personal Info Verification")) %>
<%# List(Eval("p2", "Medical History Part One")) %>
<%# List(Eval("p3", "Medical History Part Two")) %>
</ul>
</ItemTemplate>
and on the cs page:
public string List(string input)
{
if (input == "0")
return "<li>" + input + "</li>";
return "<li>value not 0</li>";
}
But it doesn't work - the 'value not 0' is returned even though the db record definitely contains a couple of 0's. Not sure if it has something to do with the db value being an integer and not nvarchar? Any suggestions or something else I could be missing?