C# how to determine type on previous page

I have a .aspx page that has radio buttons and a drop down list.  What I am doing is filling the data source for the drop down list in the page's "OnPreRenderComplete" method.  The AutoPostBack properties of both the drop down list and radio buttons is set to True, which causes the page to reload when either is changed.  In the OnPreRenderComplete method, I want to select the value of what sohuld be selected in the drop down list, but ONLY if the selected radio button is what triggered the page to be refreshed.

My question is this: how do I determine in the OnPreRenderComplete method what the event was that triggered the page to reload?
zintechAsked:
Who is Participating?
 
käµfm³d 👽Connect With a Mentor Commented:
You can query the "__EVENTTARGET" parameter that comes back in the request:

if (IsPostBack && Request.Params["__EventTarget"].StartsWith(RadioButtonList1.ID))
{
    Response.Write("Good trigger!");
}

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.