NearIn ASP. NET 2.0, A webcontrols dynamic library previously developed with. NET 1.1 is used. Two controls are inherited from the DataGrid and datalist, and the following creation error occurs:
This control is normal in ASP. NET 1.1. If you do not care about this error, you can also use it as usual, and everything works normally during running.
From the Problem description, make sure allPropertiesAre valid. ", it seems that there is a problem with the properties of the control. SetCodeI checked it carefully and found no errors. Is this creation error caused by some changes to webcontrol in ASP. NET 2.0? But there is nothing wrong with the runtime ..
At this time, the "AutoFormat" function in smarttag was accidentally selected, but another error message was accidentally found:
"Cannot create an object of Type 'hooyee. utils. pagerinfo'" from its string representation ''for the 'pagerinfo' property ."
It means that the pagerinfo object cannot be created through an empty string value of the pagerinfo attribute. It turns out that this property has an error.
Pagerinfo is a class used to save and calculate paging information. Because my datalist supports the paging function, this attribute is added.
In my understanding, the system may want to save the content of pagerinfo attribute D in HTML as text, and then deserialize or recreate a pagerinfo instance using this string value. However, my pagerinfo class does not implement serialization or reload the tostring () method, so it cannot save its value as a string type.
Because the pagerinfo attribute itself does not need to be stored in HTML, so my solution is to addDesignerserializationvisibilityattributeThis feature controls how a property is serialized during design. I am hidden here, so I won't serialize it.
[Designerserializationvisibility (designerserializationvisibility. Hidden)]
Public Pagerinfo {Get {Return_ Pagerinfo}}
After re-compilation, the problem is solved. I have not tried to add the serialization function for the pagerinfo class. I think this problem can be solved as well. If you are interested, try it.
__________________________________ 2005/01/25
the advdatalist control and pagerinfo control mentioned in this article are all used in the webpager paging control. The control is now available for source code download.
A set of embedded or independently used paging controls: webpager (source code included)