This is a migrated thread and some comments may be shown as answers.

'Request is not available in this context' exception

1 Answer 215 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 1
Gary asked on 08 Jun 2009, 05:54 PM
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?
Thanks,
Jay

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 11 Jun 2009, 07:26 AM
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.

Regards,
Veli
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.
Tags
Grid
Asked by
Gary
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or