By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,290 Members | 1,464 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,290 IT Pros & Developers. It's quick & easy.

Body onblur="window.close()"

P: n/a
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?
Apr 11 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
lindanr wrote:
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.
Apr 12 '06 #2

P: n/a
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.

"Ray Booysen" <rj***********@rjb.za.net> wrote in message
news:OQ**************@TK2MSFTNGP04.phx.gbl...
lindanr wrote:
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.

Apr 12 '06 #3

P: n/a
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.


"Kevin Spencer" wrote:
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.

"Ray Booysen" <rj***********@rjb.za.net> wrote in message
news:OQ**************@TK2MSFTNGP04.phx.gbl...
lindanr wrote:
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.


Apr 20 '06 #4

P: n/a
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.

"lindanr" <li*****@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
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.


"Kevin Spencer" wrote:
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.

"Ray Booysen" <rj***********@rjb.za.net> wrote in message
news:OQ**************@TK2MSFTNGP04.phx.gbl...
> lindanr wrote:
>> 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.


Apr 20 '06 #5

P: n/a
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.

"Kevin Spencer" wrote:
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.

"lindanr" <li*****@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
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.


"Kevin Spencer" wrote:
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.

"Ray Booysen" <rj***********@rjb.za.net> wrote in message
news:OQ**************@TK2MSFTNGP04.phx.gbl...
> lindanr wrote:
>> 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.


Apr 24 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.