469,890 Members | 2,158 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,890 developers. It's quick & easy.

window focus

Wei
I need the current window stay on focus. The user will have to click on exit
button to exit the window. How can I do this in asp.net in C#?
Thank you
Nov 18 '05 #1
5 1860
> How can I do this in asp.net in C#?

You can't. However, you CAN do it in HTML with javascript:

window.onblur = window.focus();

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Wei" <wx***@case.edu> wrote in message
news:ON**************@TK2MSFTNGP09.phx.gbl...
I need the current window stay on focus. The user will have to click on exit button to exit the window. How can I do this in asp.net in C#?
Thank you

Nov 18 '05 #2
Wei
This will help me solve the problem.
Thanks

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:O9****************@TK2MSFTNGP11.phx.gbl...
How can I do this in asp.net in C#?


You can't. However, you CAN do it in HTML with javascript:

window.onblur = window.focus();

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Wei" <wx***@case.edu> wrote in message
news:ON**************@TK2MSFTNGP09.phx.gbl...
I need the current window stay on focus. The user will have to click on

exit
button to exit the window. How can I do this in asp.net in C#?
Thank you


Nov 18 '05 #3
Wei
Hi,
I call a JAVA function at page load and I got an error message: "not
implemented".
Here is my code:

<body onload=try()>
JAVA script function:
function try() { window.onblur = window.focus(); }

Also I tried in .cs file:
private void Page_Load(object sender, System.EventArgs e)

{

Response.Write("<script>window.onblur = window.focus();</script>");

}

I got the same error message.

Thanks for your help

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:O9****************@TK2MSFTNGP11.phx.gbl...
How can I do this in asp.net in C#?


You can't. However, you CAN do it in HTML with javascript:

window.onblur = window.focus();

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Wei" <wx***@case.edu> wrote in message
news:ON**************@TK2MSFTNGP09.phx.gbl...
I need the current window stay on focus. The user will have to click on

exit
button to exit the window. How can I do this in asp.net in C#?
Thank you


Nov 18 '05 #4
Hi Wei,

Yeah, sorry about that. Add the onblur event handler to the body instead of
the window:

<body onblur="window.focus()">

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Wei" <wx***@case.edu> wrote in message
news:eb**************@TK2MSFTNGP12.phx.gbl...
Hi,
I call a JAVA function at page load and I got an error message: "not
implemented".
Here is my code:

<body onload=try()>
JAVA script function:
function try() { window.onblur = window.focus(); }

Also I tried in .cs file:
private void Page_Load(object sender, System.EventArgs e)

{

Response.Write("<script>window.onblur = window.focus();</script>");

}

I got the same error message.

Thanks for your help

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:O9****************@TK2MSFTNGP11.phx.gbl...
How can I do this in asp.net in C#?


You can't. However, you CAN do it in HTML with javascript:

window.onblur = window.focus();

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Wei" <wx***@case.edu> wrote in message
news:ON**************@TK2MSFTNGP09.phx.gbl...
I need the current window stay on focus. The user will have to click
on exit
button to exit the window. How can I do this in asp.net in C#?
Thank you



Nov 18 '05 #5
One other note: This may or may not work, depending upon the settings of the
OS. The browser will request focus from the OS, but it may not get it. You
will see the browser icon on the task bar get the focus, though, even if the
window doesn't. Not much you can do about that.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Wei" <wx***@case.edu> wrote in message
news:eb**************@TK2MSFTNGP12.phx.gbl...
Hi,
I call a JAVA function at page load and I got an error message: "not
implemented".
Here is my code:

<body onload=try()>
JAVA script function:
function try() { window.onblur = window.focus(); }

Also I tried in .cs file:
private void Page_Load(object sender, System.EventArgs e)

{

Response.Write("<script>window.onblur = window.focus();</script>");

}

I got the same error message.

Thanks for your help

"Kevin Spencer" <ks******@takempis.com> wrote in message
news:O9****************@TK2MSFTNGP11.phx.gbl...
How can I do this in asp.net in C#?


You can't. However, you CAN do it in HTML with javascript:

window.onblur = window.focus();

--
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living

"Wei" <wx***@case.edu> wrote in message
news:ON**************@TK2MSFTNGP09.phx.gbl...
I need the current window stay on focus. The user will have to click
on exit
button to exit the window. How can I do this in asp.net in C#?
Thank you



Nov 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Barry Svee | last post: by
31 posts views Thread by Benno Bös | last post: by
4 posts views Thread by Csaba Gabor | last post: by
13 posts views Thread by tochiromifune | last post: by
4 posts views Thread by Spizzat2 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.