Programmatically close aspx page from code behind

前端 未结 13 2143
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-29 05:05

What is the best way to close an ASPX page from the code-behind?

I have a button event handler that I want to close the page after the user has clicked an ASP.NET

13条回答
  •  清歌不尽
    2020-11-29 05:49

    For closing a asp.net windows application,

    • Just drag a button into the design page
    • Then write the below given code inside its click event

             "   this.close();  "
      

    ie:

     private void button2_Click(object sender, EventArgs e)  
     {
            this.Close();
     }
    

提交回复
热议问题