OK...Say you have WebForm1 and WebForm2.
WebForm2 is the "child" form, that is opened when some action on WebForm1 is done by the user.
In Web form1 you need the following JS:
Code:
<SCRIPT language="javascript">
function OpenPopUp(SomeParam)
{
var sFeatures = ''
sFeatures=''
sFeatures+='top=100,'
sFeatures+='left=200,'
sFeatures+='height=500px,'
sFeatures+='width=400px,'
sFeatures+='scrollbars=no,status=no,toolbar=no'
window.open('WebForm2.aspx?ParamName='+SomeParam,'My Popup',sFeatures)
}
function CallBackFunction(SomeData)
{
'random code here that makes webform1 update
}
</SCRIPT>
Then in Page load you do the following:
VB Code:
Me.btnDoSomething.Attributes.Add("onclick", "OpenPopupWindow(" & _SomeParam.ToString & ");return false;")
This means that when clicking on the button it runs the JS that we added to WebForm1 and opens up the popup.
Now...in WebForm2 page load:
VB Code:
Me.btnDoSomething.Attributes.Add("onclick", "Javascript:window.opener.CallBackFunction(" & _SomeParam.ToString & ");return false;")
Now when you click this it calls the call back JS on the WebForm1.
Anyways. gotta go to a meeting. Will post more tmrw.
Woooof