Search code examples
c#asp.net.netpageload

ASP.NET : Check for click event in page_load


In c#, how can I check to see if a link button has been clicked in the page load method?

I need to know if it was clicked before the click event is fired.


Solution

  • if( IsPostBack ) 
    {
        // get the target of the post-back, will be the name of the control
        // that issued the post-back
        string eTarget = Request.Params["__EVENTTARGET"].ToString();
    }