Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Event Driven in ASP.NET (Code Behind in VB.NET)

Reply
Thread Tools

Event Driven in ASP.NET (Code Behind in VB.NET)

 
 
Peri
Guest
Posts: n/a
 
      08-08-2005
Dear All,

Can anyone help me out to write event driven code in ASP.NET. That is

1. How do I get a Keypress event in a text box (or a control).
2. How do I get a Lostfocus event in a text box (or a control) Say there is
a code (user input). Once he enters the code in the lost focus event I need
to display the name.


 
Reply With Quote
 
 
 
 
Rick Strahl [MVP]
Guest
Posts: n/a
 
      08-08-2005
Hi Peri,

Web applications work differently than desktop apps and most events fired on
the client are not pushed all the way to the server - only a few are -
typically submit actions like Click events or change events on things like
lists. Most other common UI events just fire on the client and must be
handled with client side JavaScript.

You can't really do this with a Web app, unless you handle the appropriate
events in client JavaScript code (ie. onclick, onblur, onchange etc.). You
need to write script code to handle these events which are client side
events and not ASP.NET events. If you want to get really tricky you can
forward those events to the server using AJAX style messages but this is not
automatic by any stretch of the imagination.

+++ Rick ---

--

Rick Strahl
West Wind Technologies
www.west-wind.com
www.west-wind.com/weblog


"Peri" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Dear All,
>
> Can anyone help me out to write event driven code in ASP.NET. That is
>
> 1. How do I get a Keypress event in a text box (or a control).
> 2. How do I get a Lostfocus event in a text box (or a control) Say there
> is
> a code (user input). Once he enters the code in the lost focus event I
> need
> to display the name.
>
>



 
Reply With Quote
 
 
 
 
Steve C. Orr [MVP, MCSD]
Guest
Posts: n/a
 
      08-08-2005
I think you'd be best off using client side code for this kind of thing,
since a quick response precludes posting back after each individual event is
fired.

Here are some examples of adding client side code to your web controls:
http://SteveOrr.net/articles/ClientSideSuite.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"Peri" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Dear All,
>
> Can anyone help me out to write event driven code in ASP.NET. That is
>
> 1. How do I get a Keypress event in a text box (or a control).
> 2. How do I get a Lostfocus event in a text box (or a control) Say there
> is
> a code (user input). Once he enters the code in the lost focus event I
> need
> to display the name.
>
>



 
Reply With Quote
 
Lucas Tam
Guest
Posts: n/a
 
      08-08-2005
"Peri" <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> Can anyone help me out to write event driven code in ASP.NET. That is
>
> 1. How do I get a Keypress event in a text box (or a control).
> 2. How do I get a Lostfocus event in a text box (or a control) Say
> there is a code (user input). Once he enters the code in the lost
> focus event I need to display the name.


This sort of stuff can be done with Javascript + ASP.NET 2.0's client side
callbacks. If you want to do it in ASP.NET 1.1 take a look at Dart's
livecontrols or AshelyIT's (generic) and Thycotic Javascript Remoting for
ASP.NET.

--
Lucas Tam ((E-Mail Removed))
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      08-08-2005
Rick,

Will you enlighten me, where can Ajax help me in this?

Cor


 
Reply With Quote
 
Cor Ligthert [MVP]
Guest
Posts: n/a
 
      08-08-2005
Rick,

> Will you enlighten me, where can Ajax help me in this?
>

I mean seriously help me in a way that the client can type text in a textbox
using a normal tempo.

Cor


 
Reply With Quote
 
Peri
Guest
Posts: n/a
 
      08-08-2005
Thanks for all your replies.

--
Thanks and Regards,

Peri
"Peri" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Dear All,
>
> Can anyone help me out to write event driven code in ASP.NET. That is
>
> 1. How do I get a Keypress event in a text box (or a control).
> 2. How do I get a Lostfocus event in a text box (or a control) Say there

is
> a code (user input). Once he enters the code in the lost focus event I

need
> to display the name.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Event-Driven Woes: making wxPython and Twisted work together Daniel Bickett Python 2 12-30-2004 10:05 PM
Templates Specializations for Event-Driven Programming christopher diggins C++ 4 12-21-2004 06:42 AM
smart input routine, event-driven app in console?? F Java 1 07-29-2004 12:10 PM
Using signals as a event driven framework jose luis fernandez diaz C Programming 6 05-03-2004 05:42 PM
Event driven programing using Python Ben Kial Python 0 10-11-2003 11:42 PM



Advertisments