Hello!
If I add an ImageButton to my controls collection on
the server-side I get this error message when navigating
through the application:
[InvalidCastException: Specified cast is not valid.]
System.Web.UI.Page.ProcessPostData(NameValueCollection
postData, Boolean fBeforeLoad)
System.Web.UI.Page.ProcessRequestMain()
If I instead of the Microsoft-created ImageButton create
my own control (with exactly the same HTML-output) and
use this instead, the application works fine.
The same problem occurs when using the CheckBox-control
and the Microsoft TreeView-control, or if any of my
controls implements the IPostBackDataHandler-interface
and use the Page.RegisterRequiredPostBack()-function call.
Does anybody know why this happens or have a workaround
for this problem?
/jef