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

Last Reply 6 months ago By AbdulHaque

Posted 7 months 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=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable"


You are viewing reply posted by: AbdulHaque 6 months ago.
Posted 6 months 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