473,881 Members | 1,644 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 2069
> 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
4229
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
48983
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
16621
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
2865
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
3613
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
22185
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
2502
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
68057
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
17919
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
2232
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
9928
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9776
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
10718
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
10816
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
10401
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7953
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
5781
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...
1
4597
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3225
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.