473,320 Members | 2,117 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,320 software developers and data experts.

How to set focus on element inside of User Control?

Hi,

I have a user control that I am embedding within a web form. Inside
the user control are several textboxes. I would like, whenever the
user control is loaded, to set the focus to one of those textboxes. I
can't seem to figure out how to do it. I don't see a "setfocus"
method that i can call during the control's Page_Load event.

Thank you for any help you can provide.

-Neil K.
Nov 18 '05 #1
2 1824
You will have to use javascript -
onload="CONTROLNAME_TEXTBOXID.focus();"

Bobby Ryzhy
bobby@ name of domain below
http://www.weekendtech.net

On Tue, 06 Jul 2004 17:04:50 -0500, Neil Kiser
<neil@NO_SPAM_PLEASEkiserville.com> wrote:
Hi,

I have a user control that I am embedding within a web form. Inside
the user control are several textboxes. I would like, whenever the
user control is loaded, to set the focus to one of those textboxes. I
can't seem to figure out how to do it. I don't see a "setfocus"
method that i can call during the control's Page_Load event.

Thank you for any help you can provide.

-Neil K.


Nov 18 '05 #2
Jos
Bobby Ryzhy wrote:
You will have to use javascript -
onload="CONTROLNAME_TEXTBOXID.focus();"


Or wait for ASP.NET 2.0, which will have support for focus ;-)

--

Jos
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dave | last post by:
We are developing a web page that shows large graphics. To provide more screen space for the graphics, we allow the user to popup a window that places itself over the top part of the browser. This...
7
by: selen | last post by:
I am using above script for Focus to txtAdi which is textbox in c# web application.But it doesnt work. Have you any idea why it doesnt work thanks....... char c=(char)34;
3
by: Philip Townsend | last post by:
I have an aspx page that contains 2 user controls, each containing a seperate textbox and button. I would like to specify that one of the buttons recieve focus when the page loads. Also, I would...
0
by: Neil Kiser | last post by:
Hi, I have a user control that I am embedding within a web form. Inside the user control are several textboxes. I would like, whenever the user control is loaded, to set the focus to one of...
1
by: Leon | last post by:
Hi Everybody. Can someone prompt me how to set Focus on any control inside of a user control? Thanks in advance Leon
1
by: Israel | last post by:
The problem: I want to know, definitively when a slider loses focus after a user has started sliding and hasn't released the mouse yet. It appears that this is captured with the WM_ACTIVATEAPP...
7
by: Dave Booker | last post by:
I am using a WebBrowser object in my .NET 2.0 application, but it is not shown to the user. Every time a timer event triggers it to perform a m_WebBrowser.Navigate() I get that classic IE 'click'...
1
by: Praveena.Alapati | last post by:
Hi, There is a tab control on a page with multiple tabs and handful of controls in each tab. The way it's rendered in html (like grid etc..) is in table format in tablerows and cells. On...
2
by: Jonathan N. Little | last post by:
As part of a JavaScript precheck form validation I noticed a problem with trying to return focus to the field with an error. I have setup a demo page. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.