简体   繁体   中英

asp.net bootstrap alert data from database

Need help on bootstrap alert function,below is my code that use to popup alert.

            <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>

The alert text i want get from Database as well as url.The total alert will popup is depend on total data from database.

在此处输入图片说明

Your question is not much clear. Use ajax alert may fix your problem

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

Use Session variable Or Label and set value from database .

<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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM