Ajax modelpopu and progress example Learning

Source: Internet
Author: User

Modelpopu example:

1. Create an ASP. NET web project first;

2. Add a CSS file to the project,CodeAs follows:

 . Modalbackground { Background-color : Blacks ; Filter : Alpha (opacity = 60) ; Opacity : 0.6 ;} . Modalpopup { Background-color : # Ffffdd ; Border-Width :3px ; Border-style : Solid ; Border-color : Black ; Padding : 5px ; Width : 350px ; Height : 300px ;}

3. reference the Ajax control to the toolbox;

4. Add controls to the default page. The Code is as follows:

 <  ASP :  Scriptmanager  ID  = "Scriptmanager1"  Runat  = "Server"/> Are you sure you want to know the answer ?. <  ASP  :  Button  ID  = "Btnyes"  Runat  = "Server"  Text  = "Yes! "/> < BR  /> <  ASP  :  Panel  ID  = "Pnlmodal"  Runat  = "Server"  Cssclass  = "Modalpopup"  Style  ="  Display : None ; "> Sed ut specified unde omnis iste natus error sit into accusantium doloremque laudan.pdf, totam REM aperiam, eaque IPSA quae AB Illo inventore veritatis et quasi failed to beatae vitae dicta sunt explicabo. nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur Magni Dolores EOS qui ratione voluptatem Sequi nesciunt. neque porro quisquam est, qui Dolorem ipsum quia dolor sit Amet, consectetur, adipisci Velit, sed quia non numquam eius Modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. ut enim ad minima veniam, Quis nostrum exercitationem ullam extension is suscipit laboriosam, nisi ut aliquid ex EA commodi consequatur? Quis autem vel Eum iure reprehenderit qui in EA voluptate Velit esse quam nihil molestiae consequatur, Vel illum qui dolorem Eum fugiat quo voluptas nulla pariatur?<  BR  /> <  ASP  :  Button  ID  = "Btnclose"  Runat  = "Server"  Text  = "Close"/> </  ASP  :  Panel  > 

5. Place the mouse over the panel control and a smart extension will appear. The Code is as follows:

 < PC3  :  Modalpopupextender  Targetcontrolid  = "Btnyes"  ID  = "Pnlmodal_modalpopupextender"  Runat  = "Server"  Dynamicservicepath  = ""  Enabled  = "True"  Backgroundcssclass  = "Modalbackground"  Popupcontrolid = "Pnlmodal"  Cancelcontrolid  = "Btnclose"  Dropshadow  = "True"> </  PC3  :  Modalpopupextender  > 
 
Parameter description:
 
Targetcontrolid: The target control, that is, the control that appears after you click the control;
 
Popupcontrolid: the pop-up control;
 
Cancelcontrolid: it is the control for cancellation;
 
The running effect is as follows:
 
 
 
 
Example 2 Progress
 
1. Create an ASP. NET web project
 
2. Add the following code to the default page:
 
 
 <  Head  ID  = "Head1"  Runat  = "Server"> <  Title  > </  Title  > </  Head  > < Body  > <  Form  ID  = "Form1"  Runat  = "Server"> <  Div  > <  ASP  :  Scriptmanager  ID  = "Scriptmanager1"  Runat  = "Server"> </  ASP :  Scriptmanager  > <  ASP  :  Updateprogress  ID  = "Updprogress" 
   Associatedupdatepanelid  = "Updatepanel1"  Runat  = "Server"> <  Progresstemplate  > <  IMG ALT  = "Progress"  SRC  = "../Image/progress.gif"/> Processing... </  Progresstemplate  > </  ASP  :  Updateprogress  > <  ASP  :  Updatepanel  ID  = "Updatepanel1" Runat  = "Server"> <  Contenttemplate  > <  ASP  :  Label  ID  = "Lbltext"  Runat  = "Server"  Text  = ""> </  ASP  :  Label  > < BR  /> <  ASP  :  Button  ID  = "Btninvoke"  Runat  = "Server"  Text  = "Click"  Onclick  = "Btninvoke_click"/> </  Contenttemplate  > </  ASP  : Updatepanel  > </  Div  > </  Form  > </  Body  > </  Html  > Note: 
 
Associatedupdatepanelid: This is his cooperation control;
 
2. Add the following events to the button:
 
System. threading.Thread. Sleep (3000 );
Response. Redirect ("Webform1.aspx");
 
Run the following command:
 
 
 
Finally, go to the webform1.aspx page.
 
Done! Hope to help beginners;
 
Sleeping. I have to go to work tomorrow. Goodbye tomorrow night!

 
 

 
 

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.