473,396 Members | 2,158 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,396 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 2494
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.