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

Problems updating XmlHttpPanel with web service

4 Answers 111 Views
XmlHttpPanel
This is a migrated thread and some comments may be shown as answers.
baha2r
Top achievements
Rank 1
baha2r asked on 17 Apr 2010, 09:57 AM
Hi,
As I have mentioned before in this thread I'm using  an XmlHttpPanel to display some data from a RadGrid using Callback. because of performance issues I've decided to replace callback with web Service so with the help of the sample provided in here I managed to convert my code to a web service so that it returns source Code of the generated page.
now it will display data but unfortunately I'm encountering several issues:

1. whith the EnableClientScriptEvaluation set to "true" , A) JavaScript Error "Object Required" is encountered, and debugging this error points to a line that  "this._onsubmit=this._form.onsubmit;" which is apparently called here : function(a,b){Sys,WebForms.PageRequestManager.getInstance()._initializeInternal(a,b)};.. and then nothing works (javascript ,ajax..)

2. if EnableClientScriptEvaluation  is set to false , A)I can still select other rows on he column and XmlHttpPanel gets updated, but B)of course the proplem mentioned in my previous post still exists(controls are not loaded properly)  and also C)any postback event(full or Ajax) would result in this error: "The State information is invalid this page and might be corrupted."



I hope I have clarified the problem. Thanks in Advance.

p.s. described issues are encountered in IE ,In  Firefox  the experience  generally the same but with different javascript errors.

4 Answers, 1 is accepted

Sort by
0
baha2r
Top achievements
Rank 1
answered on 21 Apr 2010, 10:28 AM
UPDATE:
It turned out that the RegisterWithClientScript of one of the controls in the generated page was not set to false, After correcting that ,
with the EnableClientScriptEvaluation = True ,now in IE most part of the generated page loads fine except for some part of controls theme and then a "object is null" occurs , but again any other event in the page (clicking controls in other parts of the page return is null or not and object error ,even my custom JavaScript codes all result in null reference error.
apparently the firs error occurs on this code "...=a;this._form=b;this._onsubmit=this._form.onsubmit;" where this._form is null;
It seems that some part of a page is lost i this process?!

note: this whole page is a SharePoint Webpart , do you think the problem occurs because of the sharepoint adding a prefix to the controls ID? cause in generated source code Of the Telerik , there are references to the RadScriptManager added in the Generated page only with the ID that I set and no prefixs (e.g. $get("radscriptmanager1") ); and if Yes, are there any workarounds?

I  have no clue whats going on here and I would really appreciate any suggestions.
Thanks.
0
Pero
Telerik team
answered on 21 Apr 2010, 12:44 PM
Hi baha2r,

There is a known compatibility issue between the RadScriptManager and the RadXmlHttpPanel, as described in the following help article http://www.telerik.com/help/aspnet-ajax/radxmlhttppanel-known-issues.html. Basically you either need to use the standard ScriptManager or set RadScriptManager's EnableScriptCombine property to false.

Sincerely yours,
Pero
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
baha2r
Top achievements
Rank 1
answered on 22 Apr 2010, 10:05 AM
Dear Pero ,
Thank you for your response, Unfortunately setting the EnableScriptCombine  property of both RadScriptManagers or even replacing them with ASP.NET's ScriptManager did not solve the issue and the result seems exactly the same.

Regards

Update: I removed the RadManager from the page being  generated and the result is still the same! at the moment inside the page I'm only using a RadPanel and a RadTreeview for displaying some data and there is no postback or anything there so maybe the scriptmanager is not needed at all? Or I'm doing  it wrong?  I'm adding the the script manager to the HtmlForm like the provided example and then add my webpart containing the telerik controls to the form.
0
Pero
Telerik team
answered on 27 Apr 2010, 10:01 AM
Hello baha2r,

I created a MOSS WebPart, that contains a RadXmlHttpPanel control (and the XmlHttpPanel renders a RadTreeView control), but did not experience any problems. The ScriptManager is added directly to the MOSS MasterPage, and the page update is initiated from a button residing on the MasterPage. Here is a video captured while testing the WebPart: http://www.screencast.com/users/metalmkd/folders/Jing/media/6f1389d1-0778-4dd0-b3c4-3e6946f6ca8e, and this is the code of the WebPart:

using System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;
using Telerik.Web.UI;
 
 
namespace XmlHttpPanel
{
    [Guid("2452239b-c3df-4868-b324-e52bebb480e2")]
    public class WebPart1 : System.Web.UI.WebControls.WebParts.WebPart
    {
        public WebPart1()
        {
        }
        private RadXmlHttpPanel _xmlHttpPanel;
        public RadXmlHttpPanel xmlPanel
        {
            get
            {
                return _xmlHttpPanel;
            }
            set
            {
                _xmlHttpPanel = value;
            }
        }
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
            xmlPanel = new RadXmlHttpPanel();
            xmlPanel.ID ="XmlHttpPanel1";
            xmlPanel.EnableClientScriptEvaluation = true;
            xmlPanel.ServiceRequest += new XmlHttpPanelEventHandler(xmlPanel_ServiceRequest);
            this.Controls.Add(xmlPanel);
            // TODO: add custom rendering code here.
            // Label label = new Label();
            // label.Text = "Hello World";
            // this.Controls.Add(label);
        }
        protected void xmlPanel_ServiceRequest(object sender, RadXmlHttpPanelEventArgs e)
        {
            RadTreeView treeView = new RadTreeView();
            treeView.ID = "TreeView1";
            RadTreeNode node = new RadTreeNode("Node1");
            node.Nodes.Add(new RadTreeNode("childNode1"));
            node.Nodes.Add(new RadTreeNode("childNode2"));
            node.Nodes.Add(new RadTreeNode("childNode3"));
            RadTreeNode node1 = new RadTreeNode("Node2");
            node1.Nodes.Add(new RadTreeNode("childNode1"));
            node1.Nodes.Add(new RadTreeNode("childNode1"));
            node1.Nodes.Add(new RadTreeNode("childNode1"));
            RadTreeNode node2 = new RadTreeNode("Node3");
            treeView.Nodes.Add(node);
            treeView.Nodes.Add(node1);
            treeView.Nodes.Add(node2);
            xmlPanel.Controls.Add(treeView);
        }
    }
}

Could you please send us a working WebPart, that we can integrate in a MOSS page, and recreate the problems locally? Once we have a better look over the issue, we can provide an adequate solution.

Please note that, it is recommended that you use the later versions of the XmlHttpPanel (like the latest release, or the previous one), since a lot of improvements have been made, to make the XmlHttpPanel more compatible with the rest of the RadControls for ASP.NET AJAX.

Best wishes,
Pero
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
XmlHttpPanel
Asked by
baha2r
Top achievements
Rank 1
Answers by
baha2r
Top achievements
Rank 1
Pero
Telerik team
Share this question
or