Ajax 1.0 (updatepanel)

Source: Internet
Author: User

Http://www.cnblogs.com/terrylee/archive/2006/11/12/aspnet_ajax_quickstarts.html

Download

Http://www.microsoft.com/downloads/details.aspx? Familyid = ca9d90fa-e8c9-42e3-aa19-08e2c027f5d6 & displaylang = en

Network Abstract

Http://hi.baidu.com/balckcoffee855/blog/item/55ea4508ffc38e960b7b82d1.html

Notes

1. To use the updatepanel control to be available, you must set
The enablepartialrendering attribute is true.
2. All events triggered within updatepanel are automatically updated asynchronously without any operation.
Ensure that the control is placed in updatepanel.
3. If you need to trigger an external control, specify a trigger. Of course, this trigger must change
Control. It's really convenient.

 

Front-end

  1. <Body>
  2. <Form ID = "form1" runat = "server">
  3. <Asp: scriptmanager id = "scriptmanager1" runat = "server"/>
  4. <Div>
  5. <Asp: updatepanel id = "updatepanel1" runat = "server">
  6. <Contenttemplate>
  7. Updatepanel1 <asp: button id = "button1" runat = "server" text = "Internal Control" onclick = "button#click"/>
  8. </Contenttemplate>
  9. </ASP: updatepanel>
  10. <Asp: updatepanel id = "updatepanel2" runat = "server">
  11. <Contenttemplate>
  12. Updatepanel2 <asp: Label id = "label1" runat = "server" text = "label"> </ASP: Label>
  13. </Contenttemplate>
  14. <Triggers>
  15. <Asp: asyncpostbacktrigger controlid = "button2"/>
  16. </Triggers>
  17. </ASP: updatepanel>
  18. <Br/>
  19. <Asp: button id = "button2" runat = "server" onclick = "button2_click" text = "External Trigger"/>
  20. </Div>
  21. </Form>
  22. </Body>

Background

  1. Public partial class _ default: system. Web. UI. Page
  2. {
  3. Protected void page_load (Object sender, eventargs E)
  4. {
  5. }
  6. Protected void button#click (Object sender, eventargs E)
  7. {
  8. This. button1.text = "partially updated ";
  9. }
  10. Protected void button2_click (Object sender, eventargs E)
  11. {
  12. This. label1.text = "updated by an external trigger ";
  13. }
  14. }
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.