Asp. NET Pop-up dialog box confirmation

Source: Internet
Author: User

Directory

Click on the button in UpdatePanel to pop up the JavaScript dialog box to collect ... 1

Use the Response.Write () pop-up dialog box inside the UpdatePanel control ... 2

Asp. NET pop-up dialog box confirms ... 3

Asp. NET's GridView Delete confirmation dialog box ... 4

Gridview Pop-up dialog box ... 4

GridView Implementation Automatic Numbering ... 5

Click the button in UpdatePanel to pop up the JavaScript dialog box

<summary>

Execute JavaScript Click the button in the UpdatePanel pop-up JavaScript dialog box

</summary>

<param name= "MSG" > Tips for information </param>

<param name= address </param> after "url" > Prompt

protected void Runjavascript (String msg, string URL)

{

String javascriptstr = "";

if (URL. Length = = 0)

{

JAVASCRIPTSTR = "alert (' + msg +" '); ";

}

Else

{

JAVASCRIPTSTR = "alert (' + msg +" '); location.href= ' "+ URL +" ' ";

}

Scriptmanager.registerstartupscript (UpdatePanel1, this. GetType (), "Successalert", Javascriptstr, True);

}

<summary>

Pop-up dialog if you do not use the UpdatePanel in Ajax, you can use the following methods to eject the balloon

</summary>

<param name= "P" ></param>

<param name= "strmessage" ></param>

<author></author>

<createdate></createdate>

public static void ShowMessage (Page p, string strmessage)

{

String strscript = "<script>alert (' + strmessage + ');</script>";

P.registerstartupscript ("script", strscript);

}

Use the Response.Write () pop-up dialog box within the UpdatePanel control

Example Source:

Default.aspx

<form id= "Form1" runat= "Server" >

asp.net Ajax solutions for Response.Write () errors when using UpdatePanel controls <br/>

<asp:scriptmanager id= "ScriptManager1" runat= "Server"/>

<div>

<asp:updatepanel id= "UpdatePanel1" runat= "Server" >

<ContentTemplate>

<asp:button id= "Button3" runat= "Server" text= "invoke the generic Bullet message method" onclick= "Button3_Click"/><br/>

<asp:button id= "Button1" runat= "onclick=" Button1_Click "text=" used UpdatePanel "response"

</ContentTemplate>

</asp:UpdatePanel>

<asp:button id= "Button2" runat= "text=" is used outside UpdatePanel response "onclick=" button2_click

</form>

Default.aspx.cs

Using System;

Using System.Data;

Using System.Configuration;

Using System.Web;

Using System.Web.Security;

Using System.Web.UI;

Using System.Web.UI.WebControls;

Using Sys

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.