I found a write problem when I wrote an Ajax file today. I will share the following with you. To make JS object-oriented, but without defining the class structure, I defined an Ajax method on the server side and returned an empty object, such as m_res.
Then, after JS obtains this empty object through Ajax requests, it repeatedly uses this object structure using the clone method.
However, after the object value is filled up, it is found that the call fails because I have several datetime fields in this object. If these fields are not assigned a date object in JS, this method cannot be found on the server side (in fact, the object conversion fails ). So I will use m_res.createdate = new date ("2009/01/01 ");
Haha, the problem is solved, and there is no problem with Ajax calls.
In fact, this Ajax cannot automatically convert the string to datetime.
In addition, ajaxpro needs to register the Cs on this page in the onload event of the pageCodeClass. This is too troublesome.
I have registered the onload event in each page's base class (pagebase). For example:
Protected override void onload (eventargs E)
{
Ajaxpro. Utility. registertypeforajax (this. GetType (), this. Page );
Base. onload (E );
}