all groups > dotnet jscript > march 2008 >
You're in the

dotnet jscript

group:

how to access Dialog Box window after postBack to the server?


how to access Dialog Box window after postBack to the server? elburze
3/6/2008 4:08:01 AM
dotnet jscript:
In the bellow webPage I can access and call functions from the [modeless]
dialog window by clicking the button. My problem is that if there is any
postback to the server I loose my connection to the dialog window (new form,
new script, and 'var samp' is uninitialized again). how do I keep in touch
with the modeless dialog window after postbacks?

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>page1</title>
<script type="text/javascript">
var samp
function fnOpen(){
samp=window.open('/myProject/page2.aspx') ;
}
</script>
</head>
<body onload="fnOpen()">
<p><button onclick="samp.focus()">focus (access) Dialog window</button></p>
</body>
</html>


ways I am thinking of as possible solutions might be:
- if I could get the address or some kind of reference to the dialog window,
save it in the form, and after postback in page1's window.onload() I reset
the 'samp' to page2's window.
- if I put the whole page1.aspx in frame1 of another page, and store 'var
samp' in frame2. And if I can postback only page1 (in frame1) and not the
rest of the frames, and if I can make frame2 invisible ... it will work.
AddThis Social Bookmark Button