I have looked for a solution in VB.Net to see if i can get the events Lostfocus, gotfocus & keypress working on my textboxes. The code that i found stated that you can create the event like a custom entry & it should work but when i tried this the code was
not recognised & so did not run. The code i used is as follows:
Private
Sub txtDateRequired_KeyPress(ByVal sender
As
Object,
ByVal e
As System.Web.UI.WebControls.FormViewPageEventArgs)
Handles txtDateRequired.KeyPress
End
Sub
This doesn't not work for me. I am using asp.net version 3.5. Are there any Textbox Lostfocus, gotfocus, keypress events in vb.net using asp.net 3.5? If so, please let me know how to use them.
Regards,
Shuja Ahmad.
"4 out of 3 people have difficulty with fractions!"
Are you setting AutoPostBack=true for the TextBox? If not you should the problem is that you will have a postback if you don´t want you can solve your problem with JavaScript / AJAX with the onblur,onkeypress events
Keep it Simple!!!
DRY
YAGNI
Last Responsible Moment
I enabled the auto postback option to true for the textbox in question but i still don't have the options for Lostfocus, gotfocus or keypress available to me.
How do i get these availabe?
Regards,
Shuja Ahmad.
"4 out of 3 people have difficulty with fractions!"
I thought that this might be a straightforward task (getting a onkeypress event for a textbox to work) but i'm assuming by the lack of responses that there isn't a simple way to do this in ASP.net 3.5.
please let me know if this is not possible so that i stop trying to go down this avenue.
Regards,
Shuja Ahmad.
"4 out of 3 people have difficulty with fractions!"
dabooj
Member
14 Points
79 Posts
Textbox Lostfocus, gotfocus, keypress, etc - are these available in ASP.Net 3.5?
Oct 15, 2008 04:09 PM|LINK
Hi,
I have looked for a solution in VB.Net to see if i can get the events Lostfocus, gotfocus & keypress working on my textboxes. The code that i found stated that you can create the event like a custom entry & it should work but when i tried this the code was not recognised & so did not run. The code i used is as follows:
Private Sub txtDateRequired_KeyPress(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.FormViewPageEventArgs) Handles txtDateRequired.KeyPressEnd Sub
This doesn't not work for me. I am using asp.net version 3.5. Are there any Textbox Lostfocus, gotfocus, keypress events in vb.net using asp.net 3.5? If so, please let me know how to use them.
Regards,
"4 out of 3 people have difficulty with fractions!"
dacanetdev
Participant
1344 Points
218 Posts
Re: Textbox Lostfocus, gotfocus, keypress, etc - are these available in ASP.Net 3.5?
Oct 15, 2008 04:17 PM|LINK
Are you setting AutoPostBack=true for the TextBox? If not you should the problem is that you will have a postback if you don´t want you can solve your problem with JavaScript / AJAX with the onblur,onkeypress events
DRY
YAGNI
Last Responsible Moment
If you like my answer don't forget to mark it.
dabooj
Member
14 Points
79 Posts
Re: Textbox Lostfocus, gotfocus, keypress, etc - are these available in ASP.Net 3.5?
Oct 16, 2008 08:45 AM|LINK
Hi,
I enabled the auto postback option to true for the textbox in question but i still don't have the options for Lostfocus, gotfocus or keypress available to me.
How do i get these availabe?
Regards,
"4 out of 3 people have difficulty with fractions!"
dabooj
Member
14 Points
79 Posts
Re: Textbox Lostfocus, gotfocus, keypress, etc - are these available in ASP.Net 3.5?
Oct 17, 2008 02:04 PM|LINK
hi,
I thought that this might be a straightforward task (getting a onkeypress event for a textbox to work) but i'm assuming by the lack of responses that there isn't a simple way to do this in ASP.net 3.5.
please let me know if this is not possible so that i stop trying to go down this avenue.
Regards,
"4 out of 3 people have difficulty with fractions!"
Hua-Jun Li -...
All-Star
75950 Points
5608 Posts
Re: Textbox Lostfocus, gotfocus, keypress, etc - are these available in ASP.Net 3.5?
Oct 20, 2008 07:40 AM|LINK
Hi dabooj,
As far as I kow, the textbox do't include the events like Lostfocus, gotfocus & keypress.
It include the event 'TextChanged'. it occurs when the content of the text box changes between posts to the server.
Here is the textbox event about textbox, you can read it.
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox_members.aspx
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework