Call ~ Finally, the paging control is ready. I'm so happy to use it in a previous system.
This system is developed based on Castle's ar.
Because my paging control needs to save the datasource of the control to viewstate, and the domain object I wrote cannot be serialized, the error is as follows:
Type *** must be marked as serializable or typeconverter other than referenceconverter to be placed in view State.
I found some information online.ArticleAfter you try again and make improvements, you can solve the problem by doing the following in the business object:
1. Add namespace:
Using system. runtime. serialization;
2. Add [serializable] before the class name
3. Let the class inherit iserializable
4. Add constructor to the class:
Protected users (serializationinfo info, streamingcontext context)
{
Id = info. getstring ("ID ");
Name = info. getstring ("name ");
Createdate = info. getdatetime ("createdate ");
}
5. Implement iserializable:
Public void getobjectdata (system. runtime. serialization. serializationinfo info,
System. runtime. serialization. streamingcontext context)
{
info. addvalue ("ID", ID);
info. addvalue ("name", name);
info. addvalue ("createdate", createdate);
}< br> what are these IDs, names, and createdate? It is a property of the users class.
OK. The problem is resolved successfully.