
I'm trying to open a RadWindow from a RadGrid in a web user control from server-side code using the RadAjaxManager in my Master Page (this is .NET 2 and VS2005). In the ItemCommand event of my RadGrid I'm calling the following line of code:
RadAjaxManager
.GetCurrent(this.Page).ResponseScripts.Add("radopen(null,\"dlgTest\");");
The first time I run it I get the following error:
Sys.WebForms.PageRequestManagerParserErrorException: The message received From the server could not be, parsed. Common causes for this error are when the response is modiFied by calls to Response.WriteO, response filters, HttpModules, or server trace is enabled
Details: Error parsing near 'play:none;”>/span>|<html>
<head>
'.
Every time I select a row in the grid after cancelling this message, the dialog will load but the data does not change after the first time it loads.
Does anyone have any suggestions or sample of how I could do this? Following is a link to a test project where I've been able to reproduce the problem:
EDIT: I've updated the zip file referenced below to reflect the curernt state of this post.
http://sites.google.com/site/pbbgso/Home/TelerikGridTest.zip?attredirects=0
Just click on one of the link buttons in the grid to get the error. This is where I'd like to launch the window.
9 Answers, 1 is accepted

Try swapping the radopen() method parameters like this:
RadAjaxManager.GetCurrent(this.Page).ResponseScripts.Add("radopen('dlgTest',null);"); |
Check out this topic:
Opening windows


Yes, you are right about what each parameter is for. But note that if the second parameter is 'null', and you have RadWindowManager on the page, then new RadWindow will be open.
And on my side even this line opens new window:
RadAjaxManager1.ResponseScripts.Add("radopen('null','null')"); |
This is all the code from my test page:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %> |
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
<html xmlns="http://www.w3.org/1999/xhtml" > |
<head runat="server"> |
<title>Untitled Page</title> |
</head> |
<body> |
<form id="form1" runat="server"> |
<asp:ScriptManager ID="ScriptManager1" runat="server"> |
</asp:ScriptManager> |
<div> |
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="Button1"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="Button1" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> |
<telerik:RadWindowManager ID="RadWindowManager1" runat="server"> |
</telerik:RadWindowManager> |
</div> |
</form> |
</body> |
</html> |
using System; |
using System.Data; |
using System.Configuration; |
using System.Collections; |
using System.Web; |
using System.Web.Security; |
using System.Web.UI; |
using System.Web.UI.WebControls; |
using System.Web.UI.WebControls.WebParts; |
using System.Web.UI.HtmlControls; |
public partial class Default3 : System.Web.UI.Page |
{ |
protected void Button1_Click(object sender, EventArgs e) |
{ |
RadAjaxManager1.ResponseScripts.Add("radopen('null','null')"); |
} |
} |
Try it and see if it works with you.

Session["EventID"] = EventID;
For some reason the RadAjaxManager doesn't like this. In my test project I was able to get past this error by changing the line to:
this
.Page.Session["EventID"] = EventID;
Apparently since this is happening in a user control, I had to explicitly call the page session; otherwise, it tried to use a session object for user controls under System.Web.UI. I made a similar change in my main project code, but it still has not fixed my problem. At least now I know the problem has nothing to do with grids, or windows. It is apparently something with setting a session value prior to making a call to RadAjaxManger. Any suggestions would be greatly appreciated.


I hope the last issue could be overcome by setting the ReloadOnShow property of the window to true.
I hope this helps.

Can you please specify what type of error you receive in this particular case? Is it possible that the error you encountered when attempting to set a value in the Session is related to the subject discussed in this blog post? Try to apply the solution explained there and let me know whether this helps.
Best regards,
Sebastian
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
