Expand|Select|Wrap|Line Numbers
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Web;
- using System.Web.SessionState;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.HtmlControls;
- using System.Data.SqlClient;
- namespace TestMsgBox
- {
- /// <summary>
- /// Summary description for WebForm1.
- /// </summary>
- public class WebForm1 : System.Web.UI.Page
- {
- SqlConnection con = new SqlConnection(@"Server=IISSERVER;DataBase=TestSenthil;uid=sa;pwd=sa;");
- protected System.Web.UI.WebControls.Button btAdd;
- protected MsgBox.WebMsgBox MsgBox;
- protected System.Web.UI.WebControls.Button btNo;
- protected System.Web.UI.WebControls.Button btYes;
- protected System.Web.UI.WebControls.TextBox TextBox1;
- private void Page_Load(object sender, System.EventArgs e)
- {
- // Put user code to initialize the page here
- }
- #region Web Form Designer generated codeoverride protected void OnInit(EventArgs e)
- {
- InitializeComponent();
- base.OnInit(e);
- }
- private void InitializeComponent()
- {
- this.btAdd.Click += new System.EventHandler(this.btAdd_Click);
- this.Load += new System.EventHandler(this.Page_Load);
- }
- #endregion
- private void btAdd_Click(object sender, System.EventArgs e)
- {
- SqlDataAdapter da = new SqlDataAdapter(" select * from ScrTest",con);
- DataSet ds = new DataSet();
- da.Fill(ds,"ScrTest");
- DataView dv = new DataView(ds.Tables["ScrTest"]);
- dv.RowFilter="emailid = '" + TextBox1.Text +"'";
- if(dv.Count >0)
- {
- string lsScript="<script language='javascript'>alert('Exists');</script";
- Page.RegisterStartupScript("",lsScript);
- }
- else
- {
- string lsScript="<script language='javascript'>alert('Available');</script";
- Page.RegisterStartupScript("",lsScript);
- }
- Response.Write("Test");
- }
- }
- }
If the entered mailid exists i have displaying the Alert Message,
I have to ask confirmation from the user whether to change the enter mailid or to leave that one without updating,
while doing this the compiler executing the next line Response.Write is Executing,
how to hold the execution till getting the Confirmation(Button Click)