protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) {
// populate message to user lblFinishMessage.Text = "The report is being generated which can be up to 30 minutes. An email will be sent once the report is finished.<br><br>" + "Report details will include:<br>" + "<b>Domain:</b> " + Session[SESSION_SELECTEDDOMAIN] + "<br>" + "<b>Project:</b> " + Session[SESSION_SELECTEDPROJECT] + "<br>" + "<b>Folder Path:</b> " + selectedFolderPath;
string jScript = "<script>parent.frames[\"LeftFrame\"].location.reload();</script>"; string jScript = "<script>return displayMessage();</script>"; ClientScript.RegisterClientScriptBlock(GetType(), "keyClientBlock", jScript); ExecuteQCUtilities(); }
}
above code is in Pageload. I have observed that label doesn't display until we come out of Pageload event. I have to write the code to wait for 10sec after the button is displayed and then redirect to a different frame.
So i tried the below code
Thread.Sleep(10000); if (lblFinishMessage.Visible) Response.Redirect("QCLogin.aspx");
in Page_PreRender and also tried P Page_LoadComplete() and it still doesn't render the label. i directly redirects to different frame.
How can i wait for 10 sec after the label lblFinishMessage to be displayed and then redirect to a QCLogin.aspx?
Can someone please help me?