G
Guest
Hi ALL,
I have a javascript code which i register using
page.RegisterClientScriptBlock() in my btnFinish() button_click event.
I noticed that the debugger will run thru the whole event
for my button, before launching the javascript
code. I would like to put some c# code in the event if the javascript alert
= true, as well to do some processing. e.g.
If I put an alert javascript code ....
private void btnFinish(system....., event e ....) {
string NoAccess = " <script language='javascript'>
bool a = (alert( " Click OK to Finish, Cancel to return"))
if (a = true) then
document.getElementById("NoAccessAllowed").click();
else
return false;
</script> "
Page.RegisterClientScriptBlock("NoAccess ", NoAccess )
string strSQL = "insert into db_Student (x, y) values (x, y)"
blah blah...
}
HTML codebehind:
<a href="default.aspx" id="NoAccessAllowed" target="_parent"
type="hidden"></a>
Q: Will this C# code insert into the db table only if alert a = true ? or
will it do that everytime this event is triggered ?
TIA. cheers.
I have a javascript code which i register using
page.RegisterClientScriptBlock() in my btnFinish() button_click event.
I noticed that the debugger will run thru the whole event
for my button, before launching the javascript
code. I would like to put some c# code in the event if the javascript alert
= true, as well to do some processing. e.g.
If I put an alert javascript code ....
private void btnFinish(system....., event e ....) {
string NoAccess = " <script language='javascript'>
bool a = (alert( " Click OK to Finish, Cancel to return"))
if (a = true) then
document.getElementById("NoAccessAllowed").click();
else
return false;
</script> "
Page.RegisterClientScriptBlock("NoAccess ", NoAccess )
string strSQL = "insert into db_Student (x, y) values (x, y)"
blah blah...
}
HTML codebehind:
<a href="default.aspx" id="NoAccessAllowed" target="_parent"
type="hidden"></a>
Q: Will this C# code insert into the db table only if alert a = true ? or
will it do that everytime this event is triggered ?
TIA. cheers.