D
Darin Browne
Here is my code created when a page loads the first time:
string jScript =
@"
<script
language='javaScript'>
var pop = false;
function
CancelPage()
{
var ans =
false;
ans =
confirm('Are you sure you want to Cancel and lose any
changes?');
if (ans)
{
alert('yes');
parent.location.href = 'OrderMisc.aspx';
}
}
</script>";
if ( !IsStartupScriptRegistered
("CancelPage") )
RegisterStartupScript
("CancelPage", jScript);
btnCancel.Attributes.Add
("onclick","javascript: pop=true;CancelPage();");
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Code is called correctly when the Cancel button is
pressed because I get the confirmation box, I click yes
and I get the alert box from the code, then the page
reloads without redirecting to 'OrderMaint.aspx'.
OrderMaint.aspx is spelled correctly and in the same
directory so I'm not sure why it's not taking me there.
Any ideas?
Thanks,
Darin
string jScript =
@"
<script
language='javaScript'>
var pop = false;
function
CancelPage()
{
var ans =
false;
ans =
confirm('Are you sure you want to Cancel and lose any
changes?');
if (ans)
{
alert('yes');
parent.location.href = 'OrderMisc.aspx';
}
}
</script>";
if ( !IsStartupScriptRegistered
("CancelPage") )
RegisterStartupScript
("CancelPage", jScript);
btnCancel.Attributes.Add
("onclick","javascript: pop=true;CancelPage();");
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Code is called correctly when the Cancel button is
pressed because I get the confirmation box, I click yes
and I get the alert box from the code, then the page
reloads without redirecting to 'OrderMaint.aspx'.
OrderMaint.aspx is spelled correctly and in the same
directory so I'm not sure why it's not taking me there.
Any ideas?
Thanks,
Darin