473,399 Members | 3,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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 2032
> 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Fred Snider | last post by:
Help! Opening a new window using the window.open( ) command works great for opening new windows and having them on top and having the focus. The window.focus command brings any existing...
9
by: Randell D. | last post by:
Folks, I'm working on a contact name/address database whereby a slimed down list is shown in the main window. When a record is selected, the complete record is displayed in a new window via a...
1
by: Barry Svee | last post by:
I'm struggling with the JavaScript blur event. I have an activex control that I need to interact with when a window loses focus, namely to instruct it to give up control of a barcode scanner so...
31
by: Benno Bös | last post by:
If I use the following construct in the frame "main" for a link to an extern site: <A HREF="http://www.any.xy" TARGET="extern"> the Browser is creating the window "extern", loading the page...
4
by: Csaba Gabor | last post by:
Up until a few weeks ago, javascript code like window.open("http://mydomain.com", "windowName"); would always bring my new or reused window to the top, with focus. Lately, Firefox (Deer park...
13
by: tochiromifune | last post by:
Hello The window.open method brings my window to the top only if it is new. If it's being reused, the window does not come to the foreground (with IE 6 it does). Is there a new way in...
8
by: johnsonholding | last post by:
Here is the code for a pop-up window that works in Firefox and not in IE - I get a java error or something, Here is the code : </script> <SCRIPT language="JavaScript"...
4
by: Roger | last post by:
Hi, I am confused about the differences between this.window.focus(), window.focus(), and this.focus(). I want to use the calls in a <body onload="..."tag. What are the differences between...
7
by: chambers.anya | last post by:
Hi, I've just been scouring the web trying to find an answer for how to do this but so far without any success. Basically I want some of the links in my page to open in new tabs (I'm using...
4
by: Spizzat2 | last post by:
I'm trying to figure out a workaround to a minor annoyance that I'm coming up with while coding a site. I've got some keyboard shortcuts set up for the site via javascript, and when I press escape,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.