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

RadGrid with Update Panel and Response.Write

4 Answers 196 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Deva Kumar
Top achievements
Rank 1
Deva Kumar asked on 19 Nov 2009, 10:28 AM
Dear Experts,

I have a scenario with respect to usage of RadGrid with Update Panel and Response.Write. Could you please help on this?

I am getting - Sys.WebForms.PageRequestManagerParserErrorException.

I am placing the RadGrid within update panel to avoid the refresh problem.

I have a select button - GridButtonColumn on the rows - when I click on the select button - I invoke a response.write and I get the above error.

But I was able to avoid this error by calling the  asp:Postback trigger, but my very purpose of avoiding the screen refresh is gone.

Thanks in advance.

Thanks,
Deva

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 19 Nov 2009, 04:54 PM
Hello Deva,

I recommend you put a regular literal control inside your UpdatePanel. This will work flawlessly with AJAX - instead of using Response.Write("something"), use Literal1.Text = "something".

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Deva Kumar
Top achievements
Rank 1
answered on 19 Nov 2009, 05:19 PM
Thanks Daniel.

But my problem is like -  I am creating a string on the select button event of the RadGrid

string sScript;
lblFieldValue = e.Item.FindControl("uxLblSiteInfoAddress1") as Label;
sScript += "window.opener.document.getElementById('" + Request.QueryString["sadd1"].ToString() + "').value = '" + lblFieldValue.Text.ToString() + "';";

Similarly I will creating a very big string consisting of many values selected in the grid and finally call

sScript += "}window.opener.__doPostBack();window.close();</script>";

Response.Write(sScript);

The above script will set the values of the text box and other Hidden controls and RadDatePicker values on the invoked form.
I feel that I cannot avoid using Resposnse.Write.

Could you please give me some directions on this? Thank you - Deva

0
Accepted
Daniel
Telerik team
answered on 19 Nov 2009, 06:17 PM
Hello Deva,

Please examine the following links:
ScriptManager Class
RegisterClientScriptBlock Method
RegisterStartupScript Method

Regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Deva Kumar
Top achievements
Rank 1
answered on 19 Nov 2009, 06:30 PM
Thank you Daniel.

I will proceed with the directions provided in the link.

Thanks,
Deva
Tags
Grid
Asked by
Deva Kumar
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Deva Kumar
Top achievements
Rank 1
Share this question
or