-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: rathod_s
Message 5 in Discussion
i tried a sample application having one button as
public class ConfirmDuplicate : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Button Button1;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void Button1_Click(object sender, System.EventArgs e)
{
bool IsDuplicateName = true;
string javascript = "<script language=javascript>return confirm('Are you sure
you wish to create record for duplicate employee name?');</script>";
if( IsDuplicateName )
{
//Registers the script to client side
Response.Write(javascript);
}
//if user click yes then save the record
SaveInfo();
}
}
But error as :
"return" statement out of function
and no confirm box.
Thanks.
sashisme <[EMAIL PROTECTED]> wrote:
New Message on BDOTNET
asp.net + javascript
Reply
Reply to Sender Recommend
Message 4 in Discussion
From: sashisme
Try this.
string javascript = "<script language=javascript>return confirm('Are you sure
you wish to create record for duplicate employee name?');</script>";
if(duplicate)
{
Response.Write(javascript);
}
This way you'll get the confirm box when u need it. You might need minor tweaks
to make this suit your needs.
View other groups in this category.
Regards,
Suresh Rathod.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]