how to run procedure in server side, which will be called from client side

  • Thread starter Thread starter aa
  • Start date Start date
A

aa

I have one page PAGE.ASPX web page. from this page I can open other web page
with command "window.showModalDialog('otherpage.aspx')". I want after I
will click on button1 in the page otherpage.aspx, the modal page would be
closed and will be run sub1 in the server side of page PAGE.APSX, and if I
will click on button2 in the page otherpage.aspx, the modal page would be
closed and will be run sub2 in the server side of page PAGE.APSX.

Thank
 
Hi,

What you have to do is to get the return value from the modaldialog and act
in consequence but in order to execute a server side procedure you will have
to submit page.aspx.

in PAGE.ASPX
<script language="JavaScript">
var myVar = showModalDialog("otherpage.aspx" ," ",
"center:yes;dialogWidth:300px;scroll:no;dialogHeight:300px;help:no;status:no;unadorned:yes");
if (myVar == "ok"){
document.froms[0].submit();
}
</script>

in OtherPage.aspx:

You would have each button calling the function CloseIt with different
values
<script language="JavaScript">
function CloseIt(result){
if (result == "Close"){
window.returnValue = "ok"
window.close();
}else{
window.returnValue = "ko"
window.close();
}
}
</script>
 
Back
Top