Microsoft Ajax controls

Source: Internet
Author: User

Microsoft's Ajax controls are quite powerful.

-- Dynamic Registration in the background
Scriptmanager1.registerasyncpostbackcontrol (slider1 );

-- Use controls on the page
<Asp: updatepanel id = "updatepanelmsg" runat = "server">
<Triggers>
// Let the control in updatepanel return, that is, do not partially refresh
<Asp: postbacktrigger controlid = "btdown"/>
</Triggers>
<Triggers>
// Make the controls outside updatepanel have a partial refresh function
<Asp: asyncpostbacktrigger
Controlid = "btnchangetime" // the ID of the control that implements situation refresh
Eventname = "click"/>
// Event name for refreshing the situation. Note that it is not the method name

</Triggers>
</ASP: updatepanel>

 

This simple two-sentence setting completes a great deal of functionality, which is really easy to use. The following is an example of calling a custom JS function when Ajax is executed.

<% @ Page Language = "C #" %> <! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <SCRIPT runat = "server"> protected void button#click (Object sender, eventargs E) {system. threading. thread. sleep (1000); label1.text = datetime. now. tostring ();} protected void panel1trigger_click (Object sender, eventargs e) {system. threading. thread. sleep (1000); label1.text = datet Ime. now. tostring () + "-Trigger ";} </SCRIPT> <HTML xmlns = "http://www.w3.org/1999/xhtml"> 

Related Article

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.