I have a form with textboxes which on the first save a submit button becomes visible and when clicked it redirects to a payment page by PostBackURL. The Save creates a Session string which the payment page displays in a Label of the input details. The Sumbit.Visible forces me to save first.
When I click "go Back" by a previous-page link to edit the details, my textboxes have retained the inputs and I can make changes. When I reSave and then click submit, all is well and the Session string is displayed in the next page upon redirecting. If I click Submit without saving, I get a MessageBox popup asking "Save changes?" "Yes" "No". When I click "No", all is well again and the page is redirected with the previous saved Session string. But when I click "Yes", the page is redirected when I don't want it to. I want it to stay on the form page after clicking "Yes" so that I can Save changes and then reSubmit. I've tried Page.PostBcakURL="" in code but this doesn't work if "No" redirects (by PostBackURL). It can work if I use it a button that doesn't redirect.
protected void SubmitPayButton_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("Save changes?", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
//result = DialogResult.None;
//SubmitPayButton.Visible = false;
//SaveButton.CausesValidation = true;
//SaveButton.PerformClick();
//SubmitPayButton.PostBackUrl = "";
//None of these work
}
if (result == DialogResult.No)
{
processStr();//This works
}
}