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

Page_Load

Vi
Is there a way to determine in Page_Load as a result of what action (what
button click) the form was submitted?

Thank you
Nov 18 '05 #1
4 2491
With autopostback property set to true, there will be two hidden variable in
your form __EVENTTARGET and __EVENTARGUMENT which you can access in
Page_Load event to get the control name which caused the postback.
__EVENTTARGET will have the object which fired the post back event.

Eliyahu

"Vi" <Vi@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
Is there a way to determine in Page_Load as a result of what action (what
button click) the form was submitted?

Thank you

Nov 18 '05 #2
AFAIK no

this is a bit of a pain sometimes. you may need to delay doing some
processing until the prerender event.

In one form, I just had all the event handlers set an instance variable
called WhichButtonWasClicked. Then I did all the work in PreRender

Andy

"Vi" <Vi@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
Is there a way to determine in Page_Load as a result of what action (what
button click) the form was submitted?

Thank you

Nov 18 '05 #3
Vi
Both __EVENTTARGET and __EVENTARGUMENT return null.
I read on the web that some controls reset the value of these hidden fields.
Is there a way to overcome this problem or other ways to determine the
control that submitted the form?

Thanks.

"Eliyahu Goldin" wrote:
With autopostback property set to true, there will be two hidden variable in
your form __EVENTTARGET and __EVENTARGUMENT which you can access in
Page_Load event to get the control name which caused the postback.
__EVENTTARGET will have the object which fired the post back event.

Eliyahu

"Vi" <Vi@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
Is there a way to determine in Page_Load as a result of what action (what
button click) the form was submitted?

Thank you


Nov 18 '05 #4
execpt in the case of buttons which only pass their name in the postdata.

-- bruce (sqlwork.com)
"Eliyahu Goldin" <re*************@monarchmed.com> wrote in message
news:Oe**************@tk2msftngp13.phx.gbl...
With autopostback property set to true, there will be two hidden variable in your form __EVENTTARGET and __EVENTARGUMENT which you can access in
Page_Load event to get the control name which caused the postback.
__EVENTTARGET will have the object which fired the post back event.

Eliyahu

"Vi" <Vi@discussions.microsoft.com> wrote in message
news:DB**********************************@microsof t.com...
Is there a way to determine in Page_Load as a result of what action (what button click) the form was submitted?

Thank you


Nov 18 '05 #5

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

Similar topics

3
by: Stevie_mac | last post by:
It might be me but... I dont seem to get a Page_Load event when a opening an ASPX in an iFrame. I do geta Page_Load event when an item on the ASPX (inside the iFrame) is clicked but then...
1
by: bminder | last post by:
In the asp.net pages below, Common.vb has an overridable Page_Load sub. In the consuming page, Two.aspx, the Page_Load sub is inherited, but for some reason it (Overrides Sub Page_Load) executes...
3
by: DavidS | last post by:
Have parent.aspx from which I open Driver.aspx form via button on parent.aspx. When I first open the modal dialog, the driver.aspx Page_Load function is called. After I close the dialog, then...
0
by: Itai | last post by:
Background: I have four Web Form pages with respective C# code behind files, all in the same project: localhost/vpath1 Page1.aspx Page2.aspx
14
by: V. Jenks | last post by:
I'm a little rusty having not touched .NET for 6 months and I can't remember why Page_Load is happening twice in this code: private void Page_Load(object sender, System.EventArgs e) {...
4
by: tshad | last post by:
Is there a way to do put Page_loads on a page? I am trying to setup a Page_Load that just puts a persons name that is logged on at the top of a page the first time a page is loaded. In my...
4
by: Seraph | last post by:
Again, I'm rather new here, so if I fail to follow any etiquette, please forgive me and let me know what I've done wrong, but I think this might interest quite a few people. One of my colleaques...
5
by: Andy | last post by:
Hi all, I have a site with the following architecture: Common.Web.dll - Contains a CommonPageBase class which inherits System.Web.UI.Page myadd.dll - Contains PageBase which inherits...
1
by: rockdale | last post by:
Hi, I have a masterpage and on the page_load event I Populate my mainmenu from database. I the page_load event of my content, I am trying to programmly select the menuitem that represent...
11
by: fiefie.niles | last post by:
I am using ASP.NET 2005 and I have a simple form. Page_Load calls a sub mySub that does not do anything (for testing purposes). But, Page_Load gets called twice. On every single ASPX page in my...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: 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: 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.