Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

[ASP.NET][WebForm][C#] How to show second SweetAlert Dialog after clicking OK button ?

$
0
0

How to show second SweetAlert Dialog after clicking OK button ?

It only show the first Dialog, not show second and third. Thank you very much.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1.Default" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script src="Scripts/sweetalert.min.js"></script><link href="Styles/sweetalert.css" rel="stylesheet" /><title></title><script type="text/javascript">
        function successalert(msg) {
            swal({
                title: 'Congratulations!',
                text: msg,
                type: 'success'
            });
        }</script></head><body><form id="form1" runat="server"><div>
<%-- some codes --%><asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /></div></form></body></html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
	    ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "successalert('Message 1');", true);
	    ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "successalert('Message 2');", true);
	    ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "successalert('Message 3');", true);
        }
    }
}
// To replace by this, perhaps it is easier for everyone to understand what I want to do.



using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            // do something ....
            for (int i = 0; i < GridView1.Rows.Count(); i++)
            {
                if (ConditionTest(fieldvalue)
                {
                    // do somtehing
                    // customer ask for one popup dialogbox for each match
                    ScriptManager.RegisterStartupScript(this, GetType(), "Popup", "successalert(field_cname);", true);
                    // do somtehing
                }
            }
            // do something
        }
        string ConditionTest(string fieldvalue)
        {
            // do some thing .....
        }
    }
}




                       

Viewing all articles
Browse latest Browse all 23244

Trending Articles