John H. wrote:
> I have some trouble in closing a window, Here is the problem:
> I develop a asp.net website use client side valiation
> <asp:CustomValidator id="CustomValidator1"
> ErrorMessage="Not an even number!"
> BasicSearchValidation(source, arguments)
> w1 = window.open("PopupErrorMsg.htm", "example1", "width=400,
> height=300, location=no, menubar=no, status=no, toolbar=no,
> scrollbars=no, resizable=no");
You must make the window object reference as a global variable,
otherwise you won't be able to reference it from outside its function
for blur(), focus(), closed and close() methods and properties.
You must remove blank space between the windowFeatures string list in
the 3rd argument, otherwise such windowFeature requests won't be honored
"windowFeatures is an optional string containing a comma-separated list
of options for the new window (do not include any spaces in this list)."
Note here that either way, you are removing basic normal browser window
functionalities (resizability and scrollbars presence if needed, that is
if content overflows window dimensions) from your popup which is
definitively not recommendable (accessibility to content and usability).
You can not force the statusbar to be hidden for NS 6+ and Mozilla-based
> ASP.net will automatically call BasicSearchValidation and open a
> but when I click close button on the window
On which window exactly? window.close(), self.close(), w1.close() are 3
different calls depending on where you make such call. Here, in your
code, we have no clues at all on how and where you may be making which call.
, it always prompt a
> messagebox to ask me to close it. How can I close the window without
> the prompting the messagebox?
Check the FAQ on this.