I have a requirement to be able to optionally go straight into the report designer on page load loading a report template. I am accomplishing this right now with the following Page_PreRender event handler.
Code: Select all
protected void Page_PreRender(object sender, EventArgs e)
{
if (Session["AdHocReporting_ShowDesigner"] != null && (bool)Session["AdHocReporting_ShowDesigner"])
{
Session["AdHocReporting_ShowDesigner"] = false;
ShowReportDesigner(); //code that loads my report into the designer.
}
}
Certainly not the cleanest thing in the world, but it works well enough. My issue is that once I load the web designer like this, I can't exit out of it. When I click exit, it just reloads the designer. I think the code to reload the designer is being called before my page lifecycle events (I know it is called before page load, but I still need to check if page_init is called.) So I haven't been able to really learn much about it so far.
So why doesn't the exit button actually exit the designer in this case? The same page works just fine when a button click instantiates and loads the designer. What can I do to get this execution path to function correctly?