Hi There,
I have a child window opened from aspx page using window.open. On the
child window, I have a button(New category) which opens a grandchild. I
also have a cancel button on the child window which when clicked should
close the child and the granchild windows. Can anybody suggest me how
this can be accomplished.
I am using image buttons to do this.
This is how I am implementing, but for some reason the 'win' is
undefined.
----in the aspx page
<script language="javascript">
var win
function openwin()
{
win =
window.open('NewCategory.aspx','NewCategory','widt h=320px,height=125px,left=250px,top=500px')
win.focus()
}
function closewin()
{
if (win && win.open)
win.close()
self.close()
}
</script>
---
---in the .cs
this.New_ImgBtn.Attributes["onclick"] = "openwin();";
this.Cancel_ImgBtn.Attributes["onclick"] = "closewin();";
I cannot call the closewin() in body as onunload = "closewin()" coz
this event fires as soon as the new window opens and closes it right
away...
Can somebody get back to me as soon as possible? Thanks a lot.