I have a GridViewRow that I am trying to serialize because I am taking the data from the row to use in a couple of other rows and I want the row to be accessible on postback.
I tried this but it doesn't work:
But the error I get is:
Attribute 'Serializable' is not valid on this declaration type. It is only valid on 'class, struct, enum, delegate' declarations.
How can I make a GridViewRow property serializable?
Thanks,
Tom
I tried this but it doesn't work:
Code:
[Serializable]
public GridViewRow GVR
{
get
{
return (GridViewRow)ViewState["GVR"];
}
set
{
//if (value == string.Empty) value = "7";
ViewState["GVR"] = value;
}
}
But the error I get is:
Attribute 'Serializable' is not valid on this declaration type. It is only valid on 'class, struct, enum, delegate' declarations.
How can I make a GridViewRow property serializable?
Thanks,
Tom