ASP.Net Error: Type GridView in Assembly is not marked as serializable

Last Reply 24 days ago By AbdulHaque

Posted 26 days ago

Hello everyone,

I have a Webform with TextBoxes, Button and a GridView control with delete button column. On button click I am creating a DataTable then setting the TextBox values to DataTable columns and bind the GridView with DataTable, then to maintain the state I am using ViewState["CurrentTable"] till here, my code works fine but on clicking delete I am getting the below error. I am unable to figure out kindly help me.


"Type 'System.Web.UI.WebControls.GridView' in Assembly 'System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable"

 

Posted 24 days ago

Thanks for your valuable reply actually I found the problem as it was occurring in data binding as I was binding gridiew values to view state but was deleting rows from data table 

Thanks & Regards