Jun 08, 2010, 12:43 AM
[CLOSED] Removing and Re-adding ResourceManager
I'm creating a nice exception handling page. Since I don't know what has already been put on the page, I'd like to clear all the controls and rebuild the whole page.
The problem is that if I try to remove the ResourceManager, and re-add it it fails saying 'only one resource manger per page'.
Is there an easy solution to this?
The problem is that if I try to remove the ResourceManager, and re-add it it fails saying 'only one resource manger per page'.
Is there an easy solution to this?
protected void Page_Init(object sender, EventArgs e)
{
Form.Controls.Add(new Ext.Net.ResourceManager());
Form.Controls.Add(new Ext.Net.Panel{Html="Normal Page"} );
}
protected void Page_Load(object sender, EventArgs e)
{
try
{
throw new Exception("Bad");
}
catch(Exception)
{
Form.Controls.Clear(); // Removes all controls, Resouce Manager is no longer on page
Form.Controls.Add(new Ext.Net.ResourceManager()); // Fails
Form.Controls.Add(new Ext.Net.Panel{Html="Nice Error Page"} );
}
}