Cast ASP type object to HtmlControl
- by Joris
Hey'all
How do I cast a li dom element as HtmlControl from an ASP type object?
I tried it like this:
var li = (HtmlControl)sender;
I get a InvalidCastException...
The thing is, I want to make the li (a tab) clickable, and then update an UpdatePanel... But when I start like this
<li id="li" runat="server" onclick="tab2_Click"> FooBar </li>
I get an error because the object is not defined...
how to cast?