473,473 Members | 1,469 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How may I set the focus to a textbox on my ASP.NET webform ?

How may I set the focus to a textbox on my ASP.NET webform ?
Probably with Javascript, but I dont know how...

Any exemples ???

Thx
Nov 18 '05 #1
4 917
>How may I set the focus to a textbox on my ASP.NET webform ?
Probably with Javascript, but I dont know how...


Are you talking about serverside (i.e. after a postback) or client
side (e.g. after the user has clicked on a button or something that is
handled through clientside scripting)?

Cheers

Blu
Nov 18 '05 #2
write this in code behind..

RegisterStartupScript("Set focus","<script
language='javascript'>document.forms('formname').c ontrolname.focus();</script>");

Av.
"Eddie" <ma*************@videotron.ca> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
How may I set the focus to a textbox on my ASP.NET webform ?
Probably with Javascript, but I dont know how...

Any exemples ???

Thx

Nov 18 '05 #3
I'm talking about Serverside AND clientSide :o)

Sometimes I need to set the focus on a textbox after a postback, and
sometimes I need to set the focus on a textbox after a clientsite
validation...

Thx...


"BluDog" <nospam> wrote in message
news:35********************************@4ax.com...
How may I set the focus to a textbox on my ASP.NET webform ?
Probably with Javascript, but I dont know how...


Are you talking about serverside (i.e. after a postback) or client
side (e.g. after the user has clicked on a button or something that is
handled through clientside scripting)?

Cheers

Blu

Nov 18 '05 #4
Try this?

http://www.metabuilders.com/Tools/FirstFocus.aspx
"Eddie" <ma*************@videotron.ca> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
How may I set the focus to a textbox on my ASP.NET webform ?
Probably with Javascript, but I dont know how...

Any exemples ???

Thx


Nov 18 '05 #5

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

Similar topics

2
by: zdavid | last post by:
Hi, I have a dialog box with a multiline textbox and three buttons. The obvious thing I'm suffering with is how to give focus to the textbox, so that when the dialogbox pops up, the user could...
10
by: mg | last post by:
I want to enter characters in a TextBox in a WebForm, press a Button in the WebForm, and read the characters that were typed into the TextBox from within the Button_Click event handler. The main...
2
by: mg | last post by:
What code (javascript) will cause a WebForm to be submited (runatserver) whenever a new character is typed into a TextBox from the keyboard?
1
by: mg | last post by:
I have a MultiLine TextBox (WebForm - C#) with the MaxLength property = 1000 but am able to type in an unlimited number of characters. Is there a way to limit the number of characters that can be...
13
by: Stefan | last post by:
hello, Just a sort of newbie question. How can i change the backcolor of the controls which have the focus (textbox/combobox/datetimepicker) and set it back to white when they lost focus. thanx...
4
by: Andrew | last post by:
hi all, I have a webform that I would like do add some features. How do I : 1) setfocus in a textbox when the page first loads up; and also dynamically when I want to focus on it. 2) highlight...
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: venkatarp | last post by:
Hi , I am facing one different problem. I have dropdown and textbox. After i selected drop down textbox should focus. But its disabled and not focussing......
5
montzter
by: montzter | last post by:
Hi evryone, I'm having trouble in formatting the inputed data in the text box so that everytime user lost focus it will adjust its value to contain the format (#,####.##). ie user will input...
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
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...
1
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...
0
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...
1
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.