I have the following JS:
This works fine, and my popup window is shown.Code:function openSelectVisitor(iBookingKey) { var sFeatures = '' sFeatures='' sFeatures+='top=100,' sFeatures+='left=200,' sFeatures+='height=500px,' sFeatures+='width=400px,' sFeatures+='scrollbars=no,status=no,toolbar=no' window.showModalDialog('SelectVisitor.aspx?BookingKey='+iBookingKey,'SelectVisitor',sFeatures) }
In this popup I have a close button, and in page load I do:
Now when I click this close button the page does indeed close...but for some strange reason, another instance of this is opened, which is NOT a Modal Dialog, but instead a modeless popup...plus this time the address bar is visible.VB Code:
btnClose.Attributes.Add("onClick", "javascript:window.close();")
I have put a break point on the Page_Load event of the popup, and sure enough, when I click the close button, the Page_Load event gets fired again.
I have absolutely no other code in the popup except the btnClose.Attributes bit.
If I change my main calling JS function so it shows the Popup and modeless:
Then I do not have this problem and the popup closes fine when close.Code:window.Open('SelectVisitor.aspx?BookingKey='+iBookingKey,'SelectVisitor',sFeatures)
Any ideas?
Woka


Reply With Quote

