Last post Jul 02, 2018 09:32 AM by Brando ZWZ
Jun 30, 2018 05:02 AM|vijaylakshmi|LINK
I have a condition depending on which an alert message gets displayed and then page is redirected.
but alert message is not getting displayed and the page is directly redirected.
ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('Checking');", true);
Jun 30, 2018 09:11 AM|Mikesdotnetting|LINK
Yes - that's how the browser works. If a redirect is issued as part of the response, the browser does not wait for anything.
Jun 30, 2018 11:29 AM|mudassarkhan|LINK
Alert Message Box and Redirect to another page or website
Jul 02, 2018 09:32 AM|Brando ZWZ|LINK
So you will find the alert not work.
More details ,you could refer to below codes:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="WebFormLearning.Test" %>
<form id="form1" runat="server">
<asp:Button ID="Button1" runat="server" Text="Button" /> //just a button in the page
public partial class Test : System.Web.UI.Page
protected void Page_Load(object sender, EventArgs e)
ClientScript.RegisterStartupScript(this.GetType(), "alert", "alert('checking');window.location.href='Resources.aspx';", true);