Article ID: 327287 - Last Review: May 4, 2004 - Revision: 3.4 PRB: Error message: System.InvalidCastException: Specified Cast is not validThis article was previously published under Q327287 SYMPTOMSWhen you view
your ASP.NET page in the browser, you may receive the following error message: Specified cast is not
valid. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidCastException: Specified cast is not valid. CAUSE This problem might occur on postback because the
control tree hierarchy is re-ordered. On postback, the view state for
controls is loaded based on the positions of the controls (indexes) in the control tree. The
hierarchy that is created on postback must match the hierarchy that is used initially when the view state
is saved. RESOLUTION Make sure that the control tree is re-created on postback
in the same order that it was saved at the end of the previous
request. STATUSThis
behavior is by design.
| Article Translations
|
Back to the top
