Ajax toolkit Control Learning Series (2) -- a test of confirmbuttonextender

Source: Internet
Author: User

After ajaxtoolkit is successfully installed, a simple example is provided to verify whether the installation is successful.

First read the results.

The confirmbuttonextender control is a pop-up window that controls other controls. It must be noted that confirmtext is displayed in the pop-up window. Targetcontrolid is used to specify the control. In this example, click the BTN button to trigger confirmbuttonextender.

  <  Form  ID  = "Form1"  Runat  = "Server"  >  
< Div >
< ASP: scriptmanager ID = "SM" Runat = "Server" >
</ ASP: scriptmanager >
< ASP: updatepanel ID = "Updatepanel1" Runat = "Server" >
< Contenttemplate >
< ASP: button ID = "BTN" Runat = "Server" Text = "OK" Onclick = "Btn_onclick" />
< ASP: Label ID = "LB2" Runat = "Server" Text = "" > </ ASP: Label >
< ASP: Label ID = "LB" Runat = "Server" > </ ASP: Label >
< Ajax: confirmbuttonextender Confirmtext = "Hello World" Targetcontrolid = "BTN" ID = "CBE" Runat = "Server" >
</ Ajax: confirmbuttonextender >
</ Contenttemplate >
</ ASP: updatepanel >
</ Div >
</ Form >
 
 
Background Code :
 Code 
Namespace Alex. ajaxlearning
{
Public Partial Class _ Default: system. Web. UI. Page
{
Protected Void Page_load ( Object Sender, eventargs E)
{

}
Protected Void Btn_onclick ( Object Sender, eventargs E)
{
This . Lb2.text = This . CBE. targetcontrolid. tostring ();
This . Lb. Text = This . CBE. confirmtext. tostring ();
}
}
}
There is nothing to say. In the pop-up window, the two labels read the name and displayed content of the control's target control.
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.