<i id='0FTMk'><tr id='0FTMk'><dt id='0FTMk'><q id='0FTMk'><span id='0FTMk'><b id='0FTMk'><form id='0FTMk'><ins id='0FTMk'></ins><ul id='0FTMk'></ul><sub id='0FTMk'></sub></form><legend id='0FTMk'></legend><bdo id='0FTMk'><pre id='0FTMk'><center id='0FTMk'></center></pre></bdo></b><th id='0FTMk'></th></span></q></dt></tr></i><div id='0FTMk'><tfoot id='0FTMk'></tfoot><dl id='0FTMk'><fieldset id='0FTMk'></fieldset></dl></div>
      <bdo id='0FTMk'></bdo><ul id='0FTMk'></ul>

    <small id='0FTMk'></small><noframes id='0FTMk'>

    <tfoot id='0FTMk'></tfoot>

      <legend id='0FTMk'><style id='0FTMk'><dir id='0FTMk'><q id='0FTMk'></q></dir></style></legend>

    1. 如何防止重复回发混淆我的业务层

      时间:2023-08-27
      <legend id='gqdog'><style id='gqdog'><dir id='gqdog'><q id='gqdog'></q></dir></style></legend>
      1. <small id='gqdog'></small><noframes id='gqdog'>

            <i id='gqdog'><tr id='gqdog'><dt id='gqdog'><q id='gqdog'><span id='gqdog'><b id='gqdog'><form id='gqdog'><ins id='gqdog'></ins><ul id='gqdog'></ul><sub id='gqdog'></sub></form><legend id='gqdog'></legend><bdo id='gqdog'><pre id='gqdog'><center id='gqdog'></center></pre></bdo></b><th id='gqdog'></th></span></q></dt></tr></i><div id='gqdog'><tfoot id='gqdog'></tfoot><dl id='gqdog'><fieldset id='gqdog'></fieldset></dl></div>

              <tfoot id='gqdog'></tfoot>
                <bdo id='gqdog'></bdo><ul id='gqdog'></ul>
                  <tbody id='gqdog'></tbody>
              • 本文介绍了如何防止重复回发混淆我的业务层的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                我有一个采用传统 3 层设计的 Web 应用程序 (ASP.Net 3.5).如果用户单击一个按钮,则会发生回发,一些中间层和数据层代码会运行,并且屏幕会刷新.如果用户在第一次回发完成之前多次单击该按钮,我的逻辑会变得混乱,并且应用程序可能最终处于无效状态.预防这种情况的最佳方法是什么?

                I have a web application (ASP.Net 3.5) with a conventional 3 layer design. If the user clicks a button a postback happens, some middle and data layer code runs, and the screen is refreshed. If the user clicks the button multiple times before the first postback is completed my logic gets confused and the app can end up in an invalid state. What are the best ways to prevent this?

                我可以使用 javascript 来禁用按钮,但这只是隐藏了问题.如何构建我的业务和数据层来处理这个问题?

                I can use javascript to disable the button but this just hides the problem. How do I build my business and data layers to handle this?

                推荐答案

                最流行的三种方法(经常串联使用)是:

                The three most popular methods (which are often used in tandem) are:

                1. 禁用提交按钮一旦点击/按下;
                2. 使用 POST+REDIRECT+GET 避免返回按钮问题;和
                3. 替换浏览器中的历史记录 所以你不能去返回(但应谨慎使用,并有充分的理由).
                1. Disable submit buttons once clicked/pressed;
                2. Use POST+REDIRECT+GET to avoid back button issues; and
                3. Replace history in the browser so you can't go back (but this should be used sparingly and with good reason).

                这篇关于如何防止重复回发混淆我的业务层的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:在字典中查找重复值并打印重复元素的键 下一篇:使用 LINQ 跨多个属性查找重复项

                相关文章

                最新文章

                <small id='pSO0y'></small><noframes id='pSO0y'>

                    <i id='pSO0y'><tr id='pSO0y'><dt id='pSO0y'><q id='pSO0y'><span id='pSO0y'><b id='pSO0y'><form id='pSO0y'><ins id='pSO0y'></ins><ul id='pSO0y'></ul><sub id='pSO0y'></sub></form><legend id='pSO0y'></legend><bdo id='pSO0y'><pre id='pSO0y'><center id='pSO0y'></center></pre></bdo></b><th id='pSO0y'></th></span></q></dt></tr></i><div id='pSO0y'><tfoot id='pSO0y'></tfoot><dl id='pSO0y'><fieldset id='pSO0y'></fieldset></dl></div>
                    <tfoot id='pSO0y'></tfoot><legend id='pSO0y'><style id='pSO0y'><dir id='pSO0y'><q id='pSO0y'></q></dir></style></legend>
                      <bdo id='pSO0y'></bdo><ul id='pSO0y'></ul>