Dear All,
I have webform with textfields & with submit button.
My requirement is after clicking submit button it should show as follows
If fields are empty it should show alertbox with certain message &
if fields contains data the if should show confirm box with yes & cancel
If ther user select yes it will redirect to another page or If the user select cancel the operation will cancel & the cursor will focus to first textbox.
How to do this?
Thanks
Loading

SenthilkumarPosted Mar 29, 2012, 10:51 AM
SIVAPosted Mar 29, 2012, 11:15 AM
The code is given below for that.
if ((txtUserName.Text == "") && (txtPassword.Text == ""))
{
System.Windows.Forms.MessageBox.Show("Fields should not empty?.", "AlertMessage", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Asterisk, System.Windows.Forms.MessageBoxDefaultButton.Button1);
}
else{
if (System.Windows.Forms.MessageBox.Show("do you want to continue?.", "Confirmation Message", System.Windows.Forms.MessageBoxButtons.OKCancel, System.Windows.Forms.MessageBoxIcon.Asterisk, System.Windows.Forms.MessageBoxDefaultButton.Button1) == System.Windows.Forms.DialogResult.OK)
{
Response.Redirect("Test.aspx");
}
elseResponse.Redirect("Error.aspx");
}
}
Thanks