473,806 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2066
> 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******** ******@TK2MSFTN GP09.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******@takem pis.com> wrote in message
news:O9******** ********@TK2MSF TNGP11.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******** ******@TK2MSFTN GP09.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(objec t sender, System.EventArg s e)

{

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

}

I got the same error message.

Thanks for your help

"Kevin Spencer" <ks******@takem pis.com> wrote in message
news:O9******** ********@TK2MSF TNGP11.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******** ******@TK2MSFTN GP09.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******** ******@TK2MSFTN GP12.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(objec t sender, System.EventArg s e)

{

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

}

I got the same error message.

Thanks for your help

"Kevin Spencer" <ks******@takem pis.com> wrote in message
news:O9******** ********@TK2MSF TNGP11.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******** ******@TK2MSFTN GP09.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******** ******@TK2MSFTN GP12.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(objec t sender, System.EventArg s e)

{

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

}

I got the same error message.

Thanks for your help

"Kevin Spencer" <ks******@takem pis.com> wrote in message
news:O9******** ********@TK2MSF TNGP11.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******** ******@TK2MSFTN GP09.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
4228
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 windows to the front (top) in Netscape, IE and Opera. However, this command does nothing when you access the web page through AOL, even though they say this is IE. Once a window is behind (blurred), I have been unable to bring it back to the front...
9
48971
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 call to window.open As opposed to closing and re-opening new windows, I would prefer that when the user is finished reading the complete record, they can click a link whereby the main window is sent in to focus.
1
16606
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 that the application being brought foreward can take control. It has been my observation that when I set the window.onblur function, the window will gain focus and then immediately lose focus (blur) to the first field, button, or whatever that is...
31
2860
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 www.any.xy an setting the focus to "extern". But when I go return to "main" without closing "extern", a click to an other link (e.g. www.2nd_any.xy) on "main" does not setting the focus to "extern".
4
3609
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 alpha 2) only brings it to the top if the window 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 Mozilla/Firefox that I can ensure that this
13
22179
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 Mozilla/Firefox that I can ensure that this window comes to the top? Thank you for your help
8
2498
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" type="text/javascript"> <!-- ; var newwindow = ''
4
68053
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 these forms that may make one succeed and another fail? In particular, this.window.focus() fails in Opera 9.10 with an "object not found", and windows.focus() succeeds in Opera 9.10, Firefox 2.02, and IE 7.
7
17910
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 Firefox) or windows if the user has their options configured that way. And I want my page to remain intact as it involves some AJAX and takes a while to load. But ...and this seems to be a big "but"... I don't want the focus to
4
2227
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, it's set to hide several divs on the page, and remove focus from a link. Unfortunately, I don't know which link will have focus, so I can't just blur a particular element (that I'm aware of) since I won't know which element it is. I got it...
0
9596
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10617
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10364
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10370
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9186
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7649
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6876
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5545
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5678
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.