【问题标题】:bootstrap modal from code-behind and browser back,forward从代码隐藏和浏览器后退、前进的引导模式
【发布时间】:2014-08-29 06:00:50
【问题描述】:

我从代码隐藏调用引导模式,我的代码:

Page.ClientScript.RegisterStartupScript(this.GetType(), "myScript", "initMyModal('" + timeRemain + "');", true);

在 aspx 页面中:

function initMyModal(timeRemain) {
    $(".modal-body").html(timeRemain);
    $('#myModal').one().modal('show');
}

我的问题是当用户在浏览器中单击按钮,然后单击前进,模式再次出现。

当用户点击浏览器中的前进按钮时,如何防止显示模态框?

【问题讨论】:

    标签: c# javascript asp.net twitter-bootstrap code-behind


    【解决方案1】:

    我使用 cookie 解决了这个问题 在模态显示之前添加具有值的 cookie 当模态显示 cookie 中的设置值时

    【讨论】:

      猜你喜欢
      • 2013-03-02
      • 1970-01-01
      • 2015-08-13
      • 1970-01-01
      • 2013-07-31
      • 2012-04-16
      • 1970-01-01
      • 2011-07-28
      • 1970-01-01
      相关资源
      最近更新 更多