PrM-beginrequest event

Source: Internet
Author: User
PrM-beginrequest event
• Parameter type: beginrequesteventargs
-Request attribute: used to obtain the webrequest object (for Request Information)
-Postbackelement: Dom element that triggers asynchronous refresh
• Common Operations:
-Read Request Information
-Change the Request Method (replace executor)
-An update prompt is displayed.

Force updateprogress display
Aspx<ASP: Content ID="Content1"Contentplaceholderid="Contentplaceholder1"Runat="Server">

< ASP: updatepanel ID = " Updatepanel1 " Runat = " Server " >
< Contenttemplate >
<% = Datetime. Now %> < BR />
< ASP: button ID = " Button1 " Runat = " Server " Text = " Button1 " Onclick = " Button_onclick "   />
</ Contenttemplate >
< Triggers >
< ASP: asyncpostbacktrigger controlid = " Button2 "   />
</ Triggers >
</ ASP: updatepanel >

< ASP: updateprogress ID = " Updateprogress1 " Runat = " Server " Displayafter = " 0 " Dynamiclayout = " False "
Associatedupdatepanelid = " Updatepanel1 " >
< Progresstemplate >
< SPAN Style = " Color: red " > Loading </ Span >
</ Progresstemplate >
</ ASP: updateprogress >

< HR />
< ASP: button ID = " Button2 " Runat = " Server " Text = " Button2 " Onclick = " Button_onclick "   />

< Script Language = " Javascript " Type = " Text/JavaScript " >
SYS. webforms. pagerequestmanager. getinstance (). add_beginrequest (
Function (sender, E)
{
If (E. get_postbackelement (). ID ! =   " <% = This. button2.clientid %> " )
{
Return ;
}

VaR updateprogress = $ Get ( " <% = This. updateprogress1.clientid %> " );
VaR dynamiclayout =   <% =   This . Updateprogress1.dynamiclayout. tostring (). tolower () %> ;

If (Dynamiclayout)
{
Updateprogress. style. Display =   " Block " ;
}
Else
{
Updateprogress. style. Visibility =   " Visible " ;
}
});
</ Script >

</ASP: Content>

CSProtected VoidPage_load (ObjectSender, eventargs E)
{

}

protected void button_onclick ( Object sender, eventargs e)
{< br> thread. sleep ( 2000 );
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.