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

does page_load know

hey all,
does server-side page_load what button was pressed on a postback?

thanks,
rodchar
Oct 25 '07 #1
7 1061
rodchar wrote:
hey all,
does server-side page_load what button was pressed on a postback?

thanks,
rodchar
Not directly no. But its simple enough to set a Session variable so that
it will know.
Oct 26 '07 #2
How would that help the OP though - Page_Load event fires before OnClick
event (which I would guess is where you would set the session value).

"Mick Walker" <ma**********@privacy.netwrote in message
news:5o************@mid.individual.net...
rodchar wrote:
>hey all,
does server-side page_load what button was pressed on a postback?

thanks,
rodchar
Not directly no. But its simple enough to set a Session variable so that
it will know.

Oct 26 '07 #3
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:AD**********************************@microsof t.com...
does server-side page_load [know] what button was pressed on a postback?
Yes - Request.Form["__EVENTTARGET"]

However, it has no need to know this...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 26 '07 #4
Here's the reason i ask:

i have an UpdatePanel that contains a div which contains my web user control
called CalendarHelper.ascx. The user control consists of a textbox, calendar
image button, and calendar to help with date entry. I can load this user
control dynamically but whenever i click the calendar icon to make the
calendar appear the webcontrol just disappears on postback/async callback.

This is the only code i have and thought i would need:

protected void BtnEdit_Click(object sender, EventArgs e)
{
CalendarHelper cal1 = new CalendarHelper();
cal1 = (CalendarHelper)cal1.LoadControl("CalendarHelper.a scx");

divmain.Controls.Add(cal1);
}

p.s. i know there is an easier way to do this but i have to work with the
user control that i've been given.

"Mark Rae [MVP]" wrote:
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:AD**********************************@microsof t.com...
does server-side page_load [know] what button was pressed on a postback?

Yes - Request.Form["__EVENTTARGET"]

However, it has no need to know this...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 26 '07 #5
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:9D**********************************@microsof t.com...
i have an UpdatePanel that contains a div which contains my web user
control
called CalendarHelper.ascx. The user control consists of a textbox,
calendar
image button, and calendar to help with date entry. I can load this user
control dynamically but whenever i click the calendar icon to make the
calendar appear the webcontrol just disappears on postback/async callback.
What code is behind the calendar icon?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 26 '07 #6
all that does is toggle the calendar control's visibility.

"Mark Rae [MVP]" wrote:
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:9D**********************************@microsof t.com...
i have an UpdatePanel that contains a div which contains my web user
control
called CalendarHelper.ascx. The user control consists of a textbox,
calendar
image button, and calendar to help with date entry. I can load this user
control dynamically but whenever i click the calendar icon to make the
calendar appear the webcontrol just disappears on postback/async callback.

What code is behind the calendar icon?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 26 '07 #7

"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:9D**********************************@microsof t.com...
Here's the reason i ask:

i have an UpdatePanel that contains a div which contains my web user
control
called CalendarHelper.ascx. The user control consists of a textbox,
calendar
image button, and calendar to help with date entry. I can load this user
control dynamically but whenever i click the calendar icon to make the
calendar appear the webcontrol just disappears on postback/async callback.

This is the only code i have and thought i would need:

protected void BtnEdit_Click(object sender, EventArgs e)
{
CalendarHelper cal1 = new CalendarHelper();
cal1 = (CalendarHelper)cal1.LoadControl("CalendarHelper.a scx");

divmain.Controls.Add(cal1);
}

p.s. i know there is an easier way to do this but i have to work with the
user control that i've been given.

"Mark Rae [MVP]" wrote:
>"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:AD**********************************@microso ft.com...
does server-side page_load [know] what button was pressed on a
postback?

Yes - Request.Form["__EVENTTARGET"]

However, it has no need to know this...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

You need to reload the ascx in the page init event.

LS

Oct 26 '07 #8

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

Similar topics

3
by: Ross | last post by:
I have an aspx page containing two IFrames, each of which contain aspx pages. The mother page has a dataset filled with a single call to my Oracle database. This dataset has three tables. The...
2
by: Erick | last post by:
Hi, Is there any way that I can know the object that does fires or does postback to the page on the Page_Load event. I tried to use the sender object that is defined as parameter into this...
2
by: Jeronimo Bertran | last post by:
Hi, I have a page with a very data intensive grid which needs to be automatically refreshed constantly if a change is detected. In order to not refresh the complete page so often, I created an...
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...
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) {...
12
by: Nathan Sokalski | last post by:
What is the difference between the Page_Init and Page_Load events? When I was debugging my code, they both seemed to get triggered on every postback. I am assuming that there is some difference,...
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...
0
by: oaksong | last post by:
Looking at the locals I have "ME" and "sender". I've just clicked on a dropdownlist and it's fired a post back. I'm in the page_load. I know that after the page_load is complete it will fire the...
5
by: =?Utf-8?B?bXBhaW5l?= | last post by:
Hello, I am completely lost as to why I can't update a DropDownList inside a DetailsView after I perform an insert into an object datasource. I tried to simply it down to the core demostration:...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.