'Request is not available in this context' exception

2 posts, 0 answers
  1. Jay O'Brien
    Jay O'Brien avatar
    39 posts
    Member since:
    Dec 2008

    Posted 08 Jun 2009 Link to this post

    I am trying to render an HTML page into a local variable (basically just creating a new System.Web.UI.Page object) (See http://aspnet.4guysfromrolla.com/articles/122006-1.aspx), and then adding the Grid control to this page. When I call the System.Web.UI.Page.RenderControl, it throws an exception 'Request is not available in this context', only when the Grid control is inserted into the page.
    I guess the grid control is expecting the Request object to be valid (which technically it is not in this case). Other controls work fine ... just not the Grid control. Is there any reason the grid control would not supported being rendered like this?
  2. Veli
    Veli avatar
    2002 posts

    Posted 11 Jun 2009 Link to this post

    Hi Jay O'Brien,

    Without knowing your exact approach with this case, I made a couple of tests around this scenario. The observations are that RadGrid throws an exception requiring its scripts to be registered with the script manager on the page. A workaround is provided in the latest update of RadGrid 2009.Q1.527, where RadGrid now contains the RegisterWithScriptManager property. Setting this property to false enabled RadGrid to render its HTML to a StringWriter which can be added to an HTML page or emailed.

    You have indicated to be using v. 2009.Q1.402 of RadGrid which does not seem to be able to handle the above mentioned scripts issue when testing.

    If your problem persists, please consider opening a regular support ticket and provide us a sample runnable project where we can test under the setup you are using, to be able to better assist you.

    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top