473,324 Members | 2,456 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,324 software developers and data experts.

HOw to find which event had occurred that caused a PostBack?

Hi friends,
This is my question....

From the Page Load event (or Page Init event), I would need to find which
event had occurred that caused a PostBack, for example was it a event fired
from the datagrid that caused a postback, or was it from a linkbutton, or
was it from any other control on the page that have PostBack capabilities ?
I am pretty sure this information is captured somewhere before the event is
sent to its appropiate event-handler.

override protected void OnInit(EventArgs e)
{
/* What do I do Here to find the name of the event caused the post back?
*/
}
I have searched online and found 2 links that are exactly related to my
question that remained unsolved.. The details of these links are over here.

http://www.tek-tips.com/gpviewthread...lev2/4/lev3/32
http://www.tek-tips.com/gviewthread....855/qid/451624

Can you guys give me a sample code of how this can be achieved.

Thanks alot.

JollyK
Nov 18 '05 #1
2 4041
Examining Page.Request.Form["__EVENTTARGET"] in the
Page_Load event will give the ID of the control that
caused the postback (with the exception of command
buttons). Does this answer your question?

alex
-----Original Message-----
Hi friends,
This is my question....

From the Page Load event (or Page Init event), I would need to find whichevent had occurred that caused a PostBack, for example was it a event firedfrom the datagrid that caused a postback, or was it from a linkbutton, orwas it from any other control on the page that have PostBack capabilities ?I am pretty sure this information is captured somewhere before the event issent to its appropiate event-handler.

override protected void OnInit(EventArgs e)
{
/* What do I do Here to find the name of the event caused the post back?*/
}
I have searched online and found 2 links that are exactly related to myquestion that remained unsolved.. The details of these links are over here.
http://www.tek- tips.com/gpviewthread.cfm/qid/450403/pid/796/lev2/4/lev3/3
2http://www.tek- tips.com/gviewthread.cfm/pid/855/qid/451624
Can you guys give me a sample code of how this can be achieved.
Thanks alot.

JollyK
.

Nov 18 '05 #2
read this - might help
http://www.sitepoint.com/article/899/4

--
Regards

John Timney (Microsoft ASP.NET MVP)
----------------------------------------------
<shameless_author_plug>
Professional .NET for Java Developers with C#
ISBN:1-861007-91-4
Professional Windows Forms
ISBN: 1861005547
Professional JSP 2nd Edition
ISBN: 1861004958
Professional JSP
ISBN: 1861003625
Beginning JSP Web Development
ISBN: 1861002092
</shameless_author_plug>
----------------------------------------------

"JollyK" <Jo****@email.com> wrote in message
news:O$**************@TK2MSFTNGP11.phx.gbl...
Hi friends,
This is my question....

From the Page Load event (or Page Init event), I would need to find which
event had occurred that caused a PostBack, for example was it a event fired from the datagrid that caused a postback, or was it from a linkbutton, or
was it from any other control on the page that have PostBack capabilities ? I am pretty sure this information is captured somewhere before the event is sent to its appropiate event-handler.

override protected void OnInit(EventArgs e)
{
/* What do I do Here to find the name of the event caused the post back? */
}
I have searched online and found 2 links that are exactly related to my
question that remained unsolved.. The details of these links are over here.
http://www.tek-tips.com/gpviewthread...lev2/4/lev3/32
http://www.tek-tips.com/gviewthread....855/qid/451624

Can you guys give me a sample code of how this can be achieved.

Thanks alot.

JollyK

Nov 18 '05 #3

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

Similar topics

12
by: Bob | last post by:
In the VB.NET Page_Load() function , how can I know which control causes the page postback?
5
by: Dan | last post by:
Hi, I'd like to find out the control that caused a postback to be raised. Obviously this could simply done in a control event handler. I am not going to do this method and would like no...
3
by: William LaMartin | last post by:
If I create a RadioButtonList with, say, two items, then after the page loads and I select one of the items and then click on a button whose click event contains some code to display the...
0
by: john | last post by:
I have a dropdown with a SelectedIndexChanged event handler. I want the event to only get called if the dropdown list was the control that caused the postback. But if the value of the list is...
2
by: John Dalberg | last post by:
I need to know what happens after Page_load has finished so I put a breakpoint at the last statement. However after stepping into after this last statement, the app continues running without the...
5
by: TS | last post by:
Is there a way in debug mode to determine what event caused the postback to occur without having an event handler for that event? thanks
3
by: Phillip N Rounds | last post by:
In diagnosing a problem, I noted that a button_click event gets run only after the page Page_Load event of the post back. (VS 2003, ASPNET 1.1, C#) Can this be correct? I'm trying to set...
2
by: deborder | last post by:
hi all, im building an httphandler and need to identify which event occured in the page is there a way to do so (beside context.Request.Form.Keys which catch the postback action) Thanks in...
2
by: Paul F | last post by:
Im interested in knowning how the web control event gets passed to server and how its processed there. Like how the click event of a web control button gets called for example any sort of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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: 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...
1
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....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.