Click here to Skip to main content
15,940,246 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to update a grid list but I keep on receiving the following error message.

"Exception Details: System.InvalidCastException: Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox'."

Please help
pradiprenushe 23-Nov-12 1:26am    
Show your code where you are getting this exception & gridview design.

1 solution

What part of the error message do you not understand? It is quite clear.
You are attempting to cast an object of type LiteralControl into a TextBox.
Plain and simple, you can't do that. What you can do is set the TextBox text value from the LiteralControl text value which would be allowed.
If that doesn't help, please post the relevant code which is causing you difficulty so that we can help you further.
Share this answer
Monjurul Habib 23-Nov-12 15:52pm    

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900