Hi All,
I have a aspx page in which i create reports and charts on the fly. Creation of these charts and reports takes a lot of time because of which a blank screen is shown to the user until the creation completes.
To solve this problem I am trying to trigger report generation in a separate thread on page load and when the reportgeneration completes i am trying to set a session variable to indicate completion. I have a AJAX timer which keeps checking for this flag.
protected void Page_Load( object sender, EventArgs e )
{
if ( !IsPostBack )
{
ThreadPool.QueueUserWorkItem( new WaitCallback( DoLongRunningProcess ) );
}
}
public void GenerateReport( object state )
{
///generate report
Session[ "done" ] = true;
}
The problem is that Session is null(Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration.) when i am trying set the completion flag.
Can you guys tell me how to workaround this problem.