I have a login window to my webpage, which is inside the UpdatePanel
<asp:UpdatePanel runat="server" ClientIDMode="Static" ID="upSign" UpdateMode="Conditional"> <ContentTemplate> <div class="dvHolder hidOverflow clearfix"> <input id="txtSUser" type="text" name="SUsername" value="" placeholder="Username" runat="server" /> </div> <div class="dvHolder hidOverflow clearfix"> <input id="txtSPass" type="password" name="SPassword" value="" placeholder="Password" runat="server" /> </div> <div class="dvHolder hidOverflow clearfix setTextRight"> <asp:Button ID="btnSignIn" ClientIDMode="Static" runat="server" Text="Sign In" OnClick="btnSignIn_Click" /> <asp:Label runat="server" Text="" ID="lblSSuccess" ClientIDMode="Static" CssClass="lblMsgSuccess" /> </div> </ContentTemplate> </asp:UpdatePanel>
As soon as the user is successfully verified, I want to show the message and redirect after the delay (let them say 5 seconds). I have the following code, but it does not redirect:
public void btnSignIn_Click(object sender, EventArgs e) { lblSSuccess.Text = "We found you, now redirecting..."; lblSSuccess.ForeColor = ColorTranslator.FromHtml("#037203"); Session["UseIsAuthenticated"] = "true"; Response.AppendHeader("Refresh", "5;url=homepage.aspx"); }
The message is being updated, but for some reason the page is not being redirected.
Please help me solve the problem.
source share