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

Determining the PostBack event caller?

I am wondering if it is at all possible to ascertain what cause the PostBack
event to occur?

Currently I have a DropDownList and 2 Radio buttons that cause a PB (this
may change to 2 Buttons if I am unable to determine the calling control)
whenever their status is changed.

Is it possible to obtain the calling control/method or is this outside the
scope?
Nov 18 '05 #1
3 1926
The "Sender" event argument represents the object that fired the even. You
can use sender.getType.toString to determine what type of control cause the
postback, then you can cast sender into that type and then you could check
its name.
"Wayne" <none@none> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I am wondering if it is at all possible to ascertain what cause the PostBack event to occur?

Currently I have a DropDownList and 2 Radio buttons that cause a PB (this
may change to 2 Buttons if I am unable to determine the calling control)
whenever their status is changed.

Is it possible to obtain the calling control/method or is this outside the
scope?

Nov 18 '05 #2
Where to do you want to find out the object that caused the postback?

--
Saravana
Microsoft MVP - ASP.NET
www.extremeexperts.com

"Wayne" <none@none> wrote in message
news:#$**************@TK2MSFTNGP12.phx.gbl...
I am wondering if it is at all possible to ascertain what cause the PostBack event to occur?

Currently I have a DropDownList and 2 Radio buttons that cause a PB (this
may change to 2 Buttons if I am unable to determine the calling control)
whenever their status is changed.

Is it possible to obtain the calling control/method or is this outside the
scope?

Nov 18 '05 #3
If all else fails, sometimes you can use
request.form("__EVENTTARGET")

"Wayne" <none@none> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I am wondering if it is at all possible to ascertain what cause the PostBack event to occur?

Currently I have a DropDownList and 2 Radio buttons that cause a PB (this
may change to 2 Buttons if I am unable to determine the calling control)
whenever their status is changed.

Is it possible to obtain the calling control/method or is this outside the
scope?

Nov 18 '05 #4

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

Similar topics

2
by: David Abrahams | last post by:
Is there any way to determine the file and line number (if any) of a method's invocation from within its body? Many Thanks in advance, Dave -- David Abrahams Boost Consulting...
66
by: Darren Dale | last post by:
Hello, def test(data): i = ? This is the line I have trouble with if i==1: return data else: return data a,b,c,d = test()
3
by: James Dunkerley | last post by:
Hi, I am trying to create a class which downloads a web page in the background and then raises an event in the original thread in which it was created. This class is going to be the basis of a...
5
by: Matthew Louden | last post by:
I created simple ASP.NET web application to test how AutoPostBack property in a web control works. I set AutoPostBack property to be true of a web control. When I run the application, here's the...
4
by: RTM | last post by:
Can anyone help me with the following issue? I've seen some similar questions here, but none relating to a textbox control.... I have a form with several controls, one of them being a textbox...
3
by: darrel | last post by:
I have a page that checks to see if it's a postback on page_load. I want it to do one of two different things depending on which object triggered the postback. Is there a way to check to see which...
7
by: Michael D. Ober | last post by:
Is there anyway to raise an event from a class and require that any program using that class (not just inheritance) have an event handler for specific events in the class? In my case, some events...
11
by: antonyliu2002 | last post by:
I know that this has been asked and answered thousands of times. As a matter of fact, I know that I need to say If Not Page.IsPostBack Then 'Do something End If for things that needs to be...
2
by: John Kotuby | last post by:
Hi guys, I am converting a rather complicated database driven Web application from classic ASP to ASP.NET 2.0 using VB 2005 as the programming language. The original ASP application works quite...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.