How to check whether ASP.NET button is clicked or not on page load

前端 未结 5 832
不思量自难忘°
不思量自难忘° 2020-12-29 00:12

How can I check whether a particular button was clicked or not in ASP.NET?

I think I need to perform some operation on Page_Load. This shouldn\'t be ent

5条回答
  •  醉话见心
    2020-12-29 01:10

        private bool button1WasClicked = false;
    
        private void button1_Click(object sender, EventArgs e)
        {
            button1WasClicked = true;
        }
    
    
    if ( button1WasClicked== false)
    {
    //do somthing
    }
    

提交回复
热议问题