【问题标题】:asp.net bootstrap alert data from database来自数据库的 asp.net 引导警报数据
【发布时间】:2016-08-26 04:11:59
【问题描述】:

需要有关引导警报功能的帮助,以下是我用于弹出警报的代码。

            <div id="asd" runat="server">
            <div class="alert alert-danger" id="success-alert">
                <button type="button" class="close" data-dismiss="alert">×</button>
                <strong> Pending Approval-HR(Please approve now)</strong> <a href="CEO_m.aspx" style="color: red" class="alert-link">Click to redirect</a>
                </div>
        </div>

我想从数据库以及 url 中获取警报文本。弹出的总警报取决于数据库中的总数据。

【问题讨论】:

  • 您好 Lim,您的问题不清楚。你卡在哪里了?
  • 在引导程序中,我们使用modal 类来弹出一些对话框。
  • 所以应该使用模态而不是警报?
  • 如果您正在寻找这种警报,是的,您应该使用模态 - google.lk/…
  • 但是某些浏览器阻止了弹出,这就是为什么我决定尝试警报哈哈

标签: c# asp.net sql-server webforms bootstrapping


【解决方案1】:

你的问题不是很清楚。使用 ajax alert 可能会解决您的问题

string message = "alert('Hello! Mudassar.')";
ScriptManager.RegisterClientScriptBlock((sender as Control), this.GetType(),    "alert", message, true);

【讨论】:

    【解决方案2】:

    使用会话变量或标签并从数据库中设置值。

    <div id="asd" runat="server">
      <div class="alert alert-danger" id="success-alert">
          <button type="button" class="close" data-dismiss="alert">×</button>
           <strong> Pending Approval-HR(Please approve now)</strong> <a href="CEO_m.aspx" style="color: red" class="alert-link"><asp:Label ID="lbl_text" Text=""/></a>
      </div>
    </div>
    

    【讨论】:

      猜你喜欢
      • 2018-10-01
      • 1970-01-01
      • 2014-12-12
      • 1970-01-01
      • 2021-08-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多