Search

Friday, January 22, 2010

how to get the value of a javascript pop up confirmation box in the middle of some code. - ASP.NET Forums

how to get the value of a javascript pop up confirmation box in the middle of some code.


Untitled Page






Input "abc" in the TextBox is valid




Style="position: static; display: none" Text="Button" />





****************//code behind file
protected void Button2_Click(object sender, EventArgs e)
{
Response.Write("Process OK");
}

protected void Button1_Click(object sender, EventArgs e)
{
if (!TextBox1.Text.Equals("abc"))
{
String csname = "PopupScript";
Type cstype = this.GetType();
ClientScriptManager cs = Page.ClientScript;
if (!cs.IsStartupScriptRegistered(cstype, csname))
{
String cstext = "confirmProcess()";
cs.RegisterStartupScript(cstype, csname, cstext, true);
}
}
else
{
Response.Write("Process OK");
}
}

No comments:

Blog Archive

Contributors