Sandeep was close, but I think he got a parentheses in the wrong spot. Actually, looking at it, he's correct. But he didn't explain what your problem was.
e.Item.FindControl(NameOfControl)
returns a
Control
. A
Control
cannot be converted to a
Boolean
because they do not have an implicit conversion like the
ToString()
method. You need to actually access the value stored within the
HtmlInputHidden
object and convert that to a Boolean...assuming that you stored a Boolean value in it somewhere.
So, it should look like:
if (Convert.ToBoolean(((HtmlInputHidden)e.Item.FindControl("hiddisstatus")).Value) == true)