473,386 Members | 1,820 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,386 software developers and data experts.

Asp.Net & Event-handles

Hi, i need to catch two events in then same post (a
TextBox_TextChanged and a Button_Click), but sometimes
dot.net catch these events in one post correctly and
sometimes catch only one event (TextBox_TextChanged) and
not the event Button_Click.
Can you help me please?
Thank's.
Jul 19 '05 #1
1 3660
Since only one of these events could happen at a time (you can't change some
text at the same instant you are clicking a button), they will each cause
the page to be regenerated at the server. Once the page has been
re-generated, your event handler (for the event that caused the new page)
will fire.

You could write a generic sub and add a handler for each of the controls to
it and not write any code for the native event handlers:

Sub Do2ThingsAtOnce (byVal Sender As System.Object) Handles
TextBox.TextChanged, Button.Click

Code for textbox
Code for button

End Sub

By including the Sender parameter in the sub declaration, you could then
trap for which object raised the event (if you wanted that capability).

"Francesco" <fr***************@gruppodatel.it> wrote in message
news:04****************************@phx.gbl...
Hi, i need to catch two events in then same post (a
TextBox_TextChanged and a Button_Click), but sometimes
dot.net catch these events in one post correctly and
sometimes catch only one event (TextBox_TextChanged) and
not the event Button_Click.
Can you help me please?
Thank's.

Jul 19 '05 #2

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

Similar topics

3
by: | last post by:
How can I get the mouse coordinates in Mozilla? I try x = event.pageX but it does not work... basically I try alert(event) and it does not work. Where is the problem? the full code...
7
by: Pete | last post by:
I'm working (playing) on a mouse following script. Yes, the sort no one likes but I'm having great fun tinkering with it - sad. Anyway, if there's enough page content to cause scrolling and I...
3
by: Trevor | last post by:
Hello, How can I setup an event in C#? I would like for class A to have an event, and class B to intercept the event. Class B should not be able to call the event itself, only class A. How is...
1
by: sianan | last post by:
I tried to use the following example, to add a checkbox column to a DataGrid in an ASP.NET application: http://www.codeproject.com/aspnet/datagridcheckbox.asp For some reason, I simply CAN'T get...
3
by: Nathan Sokalski | last post by:
I have a VB.NET function that I am using in an ASP.NET page. The code creates a String, which contains && (the JavaScript Logical AND operator) and is used as part of the JavaScript sent to the...
8
by: Nathan Sokalski | last post by:
I add a JavaScript event handler to some of my Webcontrols using the Attributes.Add() method as follows: Dim jscode as String = "return (event.keyCode>=65&&event.keyCode<=90);"...
3
by: hufaunder | last post by:
I have an interface ITest that includes an event TestStatusChange. There is also a class Test that implements ITest. In one of the functions of Test I want to call the event (see code at the end)...
1
by: adeebraza | last post by:
Hi, Every Body Following is code for Showing Actual Date & Time on the form and also record Date & Time of an event. See the following and use Call Modified when you want to record an event in...
1
by: innermostsecret | last post by:
i am using dreamweaver 8 to build my site. i want to put a code in that stops people from viewing my page source and right clicking on the page. i did a google to find a code for this and used it. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.