window.open problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I must be missing something simple, but can't figure this out. I want to
popup an error notification page (showerror.aspx) if any errors occur while a
page is being processed.

I should be able to do this by putting the following code in the
LoadComplete event ...

if errsfound then

Response.Write("<script>var newwin = window.open ('ErrorPage.aspx',
'newwindow');return false;</script>")

end if

However, this code does not pop up the new window. If I take the 'return
false' out, it pops up the window but the current page refreshes, which
causes the window to popup again, and the whole thing goes into a loop.

I have tried a number of variations of this code with no success. I am using
ASP.NET 2.0 with Visual Studio 2005 (vb)

What am I missing?

Thanks in advance

Robert

Robert
 
Thanks Mark. Works great for using the alert function. I substituted the
"alert('Hello World!')" with "window.open('ErrorPage.aspx');return false;",
but still can't get a window to open with the page I want. As soon as I put
in a "return false" the window.open stops working.

I would much rather be able to open a window with a page of information than
just use the simple alert function.

Any ideas?
 
Uh, how about taking out "return false" then?



Rbrt said:
Thanks Mark. Works great for using the alert function. I substituted the
"alert('Hello World!')" with "window.open('ErrorPage.aspx');return
false;",
but still can't get a window to open with the page I want. As soon as I
put
in a "return false" the window.open stops working.

I would much rather be able to open a window with a page of information
than
just use the simple alert function.

Any ideas?
 
Back
Top