473,804 Members | 3,739 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

To sence use the gotfocus event. for textbox ASP.NET


Hi,
I want to impliment the textbox's gotfocus event.
Its not a intrincic event.
So not listed in the editor.

Waiting for an innovative reply...

Gopal Krishna

Nov 17 '05 #1
2 4461
This is a client side event, so you must add it to the HTML you're
outputting so it will be executed in the browser.
Try something like this:
MyTextBox.Attri butes.Add("onfo cus", "alert('focus!' );")

Here's more info:
http://msdn.microsoft.com/workshop/a...asp?frame=true
http://www.flws.com.au/showusyourcod...To.asp?catID=5

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Gopal Krishna Tengli" <bi***********@ yahoo.com> wrote in message
news:02******** *************** *****@phx.gbl.. .

Hi,
I want to impliment the textbox's gotfocus event.
Its not a intrincic event.
So not listed in the editor.

Waiting for an innovative reply...

Gopal Krishna

Nov 17 '05 #2
> I want to impliment the textbox's gotfocus event.
Its not a intrincic event.
So not listed in the editor.
No, but the "onfocus" event is...

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"Gopal Krishna Tengli" <bi***********@ yahoo.com> wrote in message
news:02******** *************** *****@phx.gbl.. .
Hi,
I want to impliment the textbox's gotfocus event.
Its not a intrincic event.
So not listed in the editor.

Waiting for an innovative reply...

Gopal Krishna

Nov 17 '05 #3

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

Similar topics

6
4225
by: lauren quantrell | last post by:
I have a combo box on a form. It uses the GotFocus event to poopulate the rowsource with a value list that is created on the fly in VBA. Fine and dandy, except, is a user opens another form and returns to the form with the rowsource, the rowsource is not refreshed because the combo box doesn't execute the GotFocus event because it has never lost the focus. If I put the code to generate the value list in the MouseDown event of the combo...
0
1245
by: Tom Hartnett | last post by:
This seems like it ought to be a simple thing. I am long accustomed to using the GotFocus event in VB6 to select the text in a textbox when the control is clicked in or tabbed into. C# doesn't seem to have an event named GotFocus, so I tried the Enter event (with SelectAll method). That works for tabbing into, but not clicking. So I added the MouseDown event. That works half-way: click once and the text is selected (good); click...
1
5339
by: Nathan Franklin | last post by:
I have a DataGridView on my windows form and I am trying to enable buttons on a toolbar when the DataGridView's GotFocus is called and then disable with LostFocus(). The problem is I can only get the GotFocus to fire when I click onto the header columns... when I click into the cells of the DataGridView, the LostFocus for the control is fired and my buttons disable... What am I doing wrong? Thanks in advance.
2
7826
by: Boki | last post by:
Dear All, What is the different between Enter and GotFocus events? Best reagrds, Boki.
2
1575
by: Steve | last post by:
I want to save the current value of the textbox before the user changes it - in case I want to restore it. Currently, I'm setting a local string variable equal to the text value in GotFocus. Should I be doing this in a different event, and is there a industry-standard approach to doing this? Thanks Steve
2
8064
by: Jason Huang | last post by:
Hi, In my .Net 1.1 C# windows form Form1 I have nothing but 2 TextBox controls on the Form1, the T1 and T2. I would like to test the sequence of the GotFocus LostFocus things, so I have the following code on the Form1. this.T1.LostFocus +=new EventHandler(T1_LostFocus); this.T1 .GotFocus +=new EventHandler(T1_GotFocus); this.T2 .LostFocus +=new EventHandler(T2_LostFocus);
1
4493
by: Radu | last post by:
Hi. I have... well.... not very many computer-literate users to my web- site. For the textbox which expects an email address, for instance, I had to enter a default text like "Email..." because if not, they phoned me asking questions like "What does the message 'Your email address is required' ?" :-)))
7
10890
by: thingzzz | last post by:
Hi Everyone, I know i can get the selstart when the textbox_click event fires. But I want to get the cursor position when the textbox_gotfocus event is fired. It seems to be returning a 0. I might be wrong. can you guys give me any input on this situation In simpler words, Can you please guide me as to how I can get the position of the cursor in the Textbox when the textbox gets focus. Thanks for looking
1
13883
by: moondaddy | last post by:
I have a c# 3.5 wpf app which uses user controls for data entry screens. These data entry screens can be nested inside of each. We can also have several ones open side by side at the same time. All are in a single window. My challenge is to know when a data entry screen (UC) becomes the active control, and when the active user control looses focus and when the next one gets the focus, and so on. When a user control gets or looses...
0
10580
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...
1
10323
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
10082
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...
0
9157
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...
0
6854
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
5652
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
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
2
3821
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2993
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.