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.
" +
"Report details will include:
" +
"Domain: " + Session[SESSION_SELECTEDDOMAIN] + "
" +
"Project: " + Session[SESSION_SELECTEDPROJECT] + "
" +
"Folder Path: " + selectedFolderPath;
string jScript = "";
string jScript = "";
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?
Replies
Know the answer? Post it — somebody with the same question will find it here.