ASP.NET : Check for click event in page_load

前端 未结 6 1869
孤城傲影
孤城傲影 2020-12-28 09:11

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.

6条回答
  •  孤独总比滥情好
    2020-12-28 09:45

    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();
    }
    

提交回复
热议问题