We know that some reports are too slow in computing, so we will let a page first calculate and cache it in one place, and then let the customer read the cache because the speed is too slow, I want to reflect in the computing module which is being computed. The first thing I want to think about is to jump to one module on a page one by one, in this way, we can see the current execution status on the interface, which may meet the requirements. Now I will make a slight transformation and use a page to complete it. Program Control Points
1. Configure in Web. config first < Httphandlers >
< Add verb = " Post, get " Path = " Report/*. ashx " Type = " Ajax. pagehandlerfactory, Ajax " />
</ Httphandlers >
Do not forget to add
Protected void application_start (Object sender, eventargs E)
{
Ajax. Utility. handlerpath = "report ";
}
2. It is just a program. In fact, it does not need to be changed at all as long as it is added. As mentioned by a development manager, it is not a change if it is added, is expansion. What should I add? Private Void Page_load ( Object Sender, system. eventargs E)
{
Ajax. Utility. registertypeforajax (Typeof(Report. webform1 ));
}
First Registration [Ajax. ajaxmethod]
Public String Aaaaa ()
{
Dataset result = New Dataset ();
Sqldataadapter da = New Sqldataadapter ();
Sqlcommand cmd = This . Buildquerycommand ( " XXXXXXXX " , " 1 " );
Cmd. commandtimeout = 1000 ;
Da. selectcommand = CMD;
Da. Fill (result );
Return " Aaaaa " ;
}
[Ajax. ajaxmethod]
Public String Bbbbb ()
{
Dataset result = New Dataset ();
Sqldataadapter da = New Sqldataadapter ();
Sqlcommand cmd = This . Buildquerycommand ( " XXXXXXXX " , " 1 " );
Then you can test all the methods you have previously written, and then write [Ajax. ajaxmethod] on the head. The background will be OK, mainly at the front-end, < Script Language = " Javascript " >
Function Callback_testa (RES)
{
Invalid parameters Doc ument. form1.all ("SS"). Value+ =Res. value;
Webform1.bbbbb (callback_testb );
}
Function Callback_testb (RES)
{
Invalid parameters Doc ument. form1.all ("SS"). Value+ =Res. value;
Webform1.ccccc (callback_testc );
}
Function Callback_testc (RES)
{
Invalid parameters Doc ument. form1.all ("SS"). Value+ =Res. value;
Webform1.ddddd (callback_testd );
}
Function Callback_testd (RES)
{
Invalid parameters Doc ument. form1.all ("SS"). Value+ =Res. value;
}
Function Test1 ()
{
Webform1.aaaaa (callback_testa );
}
Window. onbeforeunload = Function ()
{
Window. event. returnvalue= False;
}
</ Script >
This mainly completes the display at the front end. Note that the called method is to use the class name you registered. You can just use your method name.
So the effect will come out.
There are not many changes, the way programming looks, and the effects of implementation are greatly changed. Although the essence is not changed, there are indeed many changes in the big environment.