【问题标题】:Prevent button_click event in page refresh in c#在c#中的页面刷新中防止button_click事件
【发布时间】:2013-02-25 09:28:32
【问题描述】:

我想在页面刷新时阻止 button_click 事件。 我已经搜索过,但找不到任何与我相关的解决方案。 我找到了这个:
http://www.dotnetspider.com/resources/42823-How-Avoid-Re-Submitting-Data-Page-Refresh.aspx

但我不需要在页面刷新时进入 button_click 事件。

Response.Redict("") 在这里也不相关,因为我在成功 button_click 后返回标签文本。

【问题讨论】:

    标签: c# asp.net


    【解决方案1】:

    你要找的不是那么简单。

    您可以肯定使用的解决方案是Post/Redirect/Get 设计模式

    或使用一些代码尝试检测页面的刷新:

    http://www.codeproject.com/KB/aspnet/DetectingRefresh_.aspx

    http://dotnetslackers.com/community/blogs/simoneb/archive/2007/01/06/Using-an-HttpModule-to-detect-page-refresh.aspx

    【讨论】:

      猜你喜欢
      • 2010-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-25
      • 1970-01-01
      • 1970-01-01
      • 2021-09-21
      相关资源
      最近更新 更多