[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webcontrols

Problems with ProcessPostData and the ImageButton or CheckBox control

jef

1/23/2003 8:38:00 AM

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