Body onblur="window.close()"

G

Guest

In ASP.NET 2005 I have an onblur="window.close()" javascript event in the
<body> tag. When I click on the window's scrollbar, the window closes. The
same code works fine in ASP.NET 2003.

Any ideas?
 
R

Ray Booysen

lindanr said:
In ASP.NET 2005 I have an onblur="window.close()" javascript event in the
<body> tag. When I click on the window's scrollbar, the window closes. The
same code works fine in ASP.NET 2003.

Any ideas?
What do you expect to happen and what is not occuring? Sounds like its
working in both instances.
 
K

Kevin Spencer

What Ray means is that the window is not the body. The scrollbar is part of
the window.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.
 
G

Guest

Thanks for your response. Perhaps I should be more descriptive.

A link on an aspx page has an onclick event using window.open() to open a
popup aspx page that is resized and moved using javascript at onload(). The
<body> tag has the onblur="window.close()" method because I want the window
to close if the user clicks the underlying window.

The popup window contains text that may not be entirely visible to the user,
so the window.open() features include displaying the window's scrollbar. In
ASP .NET 2003, the scrollbar is functional; the user can click it and scroll
to see all text in the window. The window closes if the user clicks off the
popup window. This is how I expect/intend it to function.

However, in ASP .NET 2005 clicking the scrollbar on the popup window causes
the window to close. This is not the expected action, and not what happens in
ASP .ET 2003.

Interestingly, in ASP .NET 2005 when I use the
window.onblur="window.close()" method the scrollbar functions but the window
does NOT close when the user clicks off the popup window. Obviously the
onblur method is not firing.

What am I missing here? Is there another way I can accomplish this other
than the javascript method that is not working the same in 2005 as it does in
2003?

Thanks for any explanation, advice or ideas.
 
K

Kevin Spencer

Regardless of what version of ASP.Net was used to create the web app, the
ASP.Net is on the server side, and on the client side it's still good ol'
HTML, CSS, and JavaScript. I don't know what is diffreent between the HTML
and JavaScript you were getting before, and the HTML and JavaScript you're
getting now, but I do know that the scrollbar of a window is not now, nor
ever has been, part of the body. Do you have a URL we can look at?

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.
 
G

Guest

I pulled out the relevant code and put up 2 simple sites. They are:

http://www.rtmdesigns.net/popup03

67.33.61.27/popup05

As you'll see the scrollbar functions in the '03 version, but is
inaccessible in the '05 version. There's no code behind; all source is in the
html page.

Thanks for any analysis and conclusions you can give me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top