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

determining which object trigger postback on page_load

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 object triggered the
postback?

-Darrel
Nov 18 '05 #1
3 1586
Edd
Darrel,

You might want to move your code from Page_Load to separate event handlers
for your controls. They will then be triggered when the relevant control is
clicked / modified.

Edd.

"darrel" <no*****@hotmail.com> wrote in message
news:ek**************@TK2MSFTNGP10.phx.gbl...
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 object triggered the
postback?

-Darrel

Nov 18 '05 #2
> You might want to move your code from Page_Load to separate event handlers
for your controls. They will then be triggered when the relevant control is clicked / modified.


Yea. I think you're right about that. Might have to rethink this page's
codebehind now. ;o)

-Darrel
Nov 18 '05 #3
Remember too, the sender parameter to an event represents the object
that fired the event.

--
Scott
http://www.OdeToCode.com

On Tue, 10 Aug 2004 16:09:17 -0500, "darrel" <no*****@hotmail.com>
wrote:
You might want to move your code from Page_Load to separate event handlers
for your controls. They will then be triggered when the relevant control

is
clicked / modified.


Yea. I think you're right about that. Might have to rethink this page's
codebehind now. ;o)

-Darrel


Nov 18 '05 #4

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

Similar topics

6
by: V | last post by:
I have found that when I have a composite control that uses the CreateChildControls method, on a regular page load, Page_Load executes before CreateChildControls, but on a postback it is the...
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: Kevin Phifer | last post by:
Ok, before anyone freaks out, I have a solution I need to create that gathers content from maybe different places. Each one can return a <form> in the html, so its the classic can't have more than...
4
by: NWx | last post by:
Hi, How can I make a page to postback automatically, using JavaScript? I need a JavaScript function as handled to page_load, but I don't know what code to write to trigger postback. Can...
13
by: Max | last post by:
Hi There! I'm having a mysterious error right after I login using Forms Authentication in my ASP.NET app. Below is the error... Exception Details: System.NullReferenceException: Object...
5
by: Nathan Sokalski | last post by:
I have a DataList that I was having trouble getting the events for. After a bit of help, I realized that I needed to put the databinding inside an If Not IsPostBack() condition. Although this fixed...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
9
by: Jaybuffet | last post by:
my aspx has something like this <asp:Repeater id="Repeater1" runat="server"> <ItemTemplate> <mycontrol:ctl id="ctlId" obj='<%# Container.DataItem %>' showItem="true"/> </ItemTemplate>...
1
by: AbeR | last post by:
I'm trying to set a level of abstraction in an ASP.NET app. I've created an object with properties and methods that I instansiate just after the class declaration. As I'm debugging this code I find...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.