Regular ajax usage

Source: Internet
Author: User

<Asp: ScriptManager ID = "ScriptManager1" runat = "server">
</Asp: ScriptManager>

<Asp: UpdatePanel ID = "UpdatePanel1" runat = "server">
<ContentTemplate>

<Asp: UpdateProgress ID = "UpdateProgress1" runat = "server">
<ProgressTemplate>
Operating... please wait...
</ProgressTemplate>
</Asp: UpdateProgress>
<Asp: Label ID = "Label2" runat = "server" Text = "Label"> </asp: Label>
<Br/> <Asp: Button ID = "Button1" runat = "server" onclick = "button#click" Text = "Internal Control" Width = "pixel PX"/>
</ContentTemplate>
<Triggers> <! -- Customize events for controls outside updatepanel --"
<Asp: AsyncPostBackTrigger ControlID = "Button2" EventName = "click"/> <! -- Refresh this local page -->
<Asp: PostBackTrigger ControlID = "Button3"/> <! -- Refresh the entire page -->
</Triggers>
</Asp: UpdatePanel>

 

Master page update content form

Motherboard page:

<Asp: ScriptManager ID = "ScriptManager1" runat = "server">
</Asp: ScriptManager>
<Asp: UpdatePanel ID = "UpdatePanel1" runat = "server">
<ContentTemplate>
<Asp: Button ID = "Button1" runat = "server"
Text = "Button" Width = "92px"
Onclick = "button#click"/>
</ContentTemplate>
</Asp: UpdatePanel>

Protected void Page_Load (object sender, EventArgs e)
{
ScriptManager1.RegisterAsyncPostBackControl (Button1 );
}
Protected void button#click (object sender, EventArgs e)
{
(UpdatePanel) ContentPlaceHolder1.FindControl ("UpdatePanel2"). Update ();
TextBox tex = (TextBox) ContentPlaceHolder1.FindControl ("TextBox1 "));
Tex. Text = DateTime. Now. ToLongTimeString ();
}

Content Page:

<Asp: Content ID = "Content2" ContentPlaceHolderID = "ContentPlaceHolder1" Runat = "Server">
<Asp: UpdatePanel ID = "UpdatePanel2" runat = "server" UpdateMode = "Conditional">
<ContentTemplate>
<Asp: TextBox ID = "TextBox1" runat = "server"> </asp: TextBox>
</ContentTemplate>
</Asp: UpdatePanel>
</Asp: Content>

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.