<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default_TestPopModal" %> <%@ Register Assembly="ncToolControls" Namespace="ncToolControls" TagPrefix="nc" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Modal Popup</title> <script type="text/javascript"> function confirm_popup() { alert("Thnk you for confirming"); } function close_popup() { alert("Good bye"); } </script> </head> <body> <form id="form1" runat="server"> <div> <!---Add the button that will trigger to open the modal popup ---> <p><input type="button" id="myBtn" value="Open" /></p> <!--- Add the Modal Popup Control ---> <nc:PopModal ID="ctr12" Width="50" Height="40" runat="server" /> </div> </form> </body> <script> document.getElementById("rq1").addEventListener('click', function () { document.getElementById("myBtn").click(); }); document.getElementById("rq2").addEventListener('click', function () { document.getElementById("myBtn").click(); }); </script> </html>
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; public partial class Default_TestPopModal : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string HTML_CONTENT = "<table width='100%' id='table1'>"; HTML_CONTENT += "<tr>"; HTML_CONTENT += "<td align='center'>Do you wish to continue?</td>"; HTML_CONTENT += "</tr>"; HTML_CONTENT += "<tr><td align='center'> </td></tr>"; HTML_CONTENT += "<tr>"; HTML_CONTENT += "<td align='right'>"; HTML_CONTENT += "<input type='button' id='rq1' onclick='javascript:confirm_popup()' value='Yes' /> "; HTML_CONTENT += "<input type='button' id='rq2' value='No' onclick='javascript:close_popup()' /></td>"; HTML_CONTENT += "</tr>"; HTML_CONTENT += "</table>"; //- Add the header title this.ctr12.lblHeaderMessage.Text = "Confirm"; //- Modal Popup Content this.ctr12.litModalPopupContent.Text = HTML_CONTENT; //- Add the footer message this.ctr12.lblFooterMessage.Text = "Modal Popup Confirm"; } }
Trouble logging in? Simply enter your email address OR username in order to reset your password.
For faster and more reliable delivery, add support@netstaircom.net to your trusted senders list in your email software.