Monday, 2 April 2012

To show the alert message and call the java script from the .cs page in ASP.Net

           ClientScript.RegisterStartupScript(this.GetType(), "ShowMessage", "confirmLogin();", true);
-------------------------------------------------
            //ClientScript.RegisterStartupScript(typeof(Page), "MessagePopUp", "alert('Registration successfully'); window.location.href ='frmContentPlaceHolder.aspx';", true);
-------------------------------------------------
<script language="javascript" type="text/javascript">
        function confirmLogin() {
            var answer = confirm("Registration successful.Do you want to login now?");
            if (answer)
            {
                window.open("frmContentPlaceHolder.aspx", "_parent", "", "");
            }
            else
             {
                 return false;
             }

             }
        </script>

No comments:

Post a Comment