I have the following JS:
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)
}
This works fine, and my popup window is shown.

In this popup I have a close button, and in page load I do:
VB Code:
  1. btnClose.Attributes.Add("onClick", "javascript:window.close();")
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.
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:
Code:
window.Open('SelectVisitor.aspx?BookingKey='+iBookingKey,'SelectVisitor',sFeatures)
Then I do not have this problem and the popup closes fine when close.

Any ideas?

Woka