<html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>jQuery UI Dialog - Default functionality</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <link rel="stylesheet" href="/resources/demos/style.css"> <script type="text/javascript" language="javascript"> function showAlert() { $("#dialog").dialog(); setTimeout(TimeOut, 5000); //1000 ms = 1 second } function TimeOut() { $("#dialog").dialog("close"); //window.location = "Your redirect URL"; } </script></head><body> <form id="form1" runat="server"> <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" /> <div id="dialog" title="Alert" style="display: none;"> <p> Set you message here.</p> </div> </form></body></html>
public partial class _Default : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { } protected void btnSubmit_Click(object sender, EventArgs e) { //Do you Insert logic. ClientScript.RegisterStartupScript(typeof(Page), "Test", "<script type='text/javascript'>showAlert();</script>"); }}
Thanks and Regards Chandradev My Blog
<p style="text-align:center">This window will close automatically within <span id="counter">10</span> second(s).</p><script type="text/javascript"> function countdown() { var i = document.getElementById('counter'); i.innerHTML = parseInt(i.innerHTML)-1; if (parseInt(i.innerHTML)<=0) { window.close(); }}setInterval(function(){ countdown(); },1000);</script>
Login to post response