May 12, 2009, 7:30 PM
TreePanel WebService Loader doesn't work in "production server"
Hi guys !
I have a really strange issue with the WebService Loader for a TreePanel. If I run my project with Visual Web Developer, the "default.aspx" page looks OK. The TreePanel loads successfully.
Also, if I put the project in the "wwwroot" folder of the IIS, and open it with a browser from the same computer that i'm working, everything is OK too.
The problem comes when I open a browser in a different computer, and try to access the project (ie. http://myserver/WebServices). The page doesn't display the TreePanel.
At this point, I don't know if it's a problem with the IIS itself, or another issue of configuration.
Here is my code:
Default.aspx
Best regards.
I have a really strange issue with the WebService Loader for a TreePanel. If I run my project with Visual Web Developer, the "default.aspx" page looks OK. The TreePanel loads successfully.
Also, if I put the project in the "wwwroot" folder of the IIS, and open it with a browser from the same computer that i'm working, everything is OK too.
The problem comes when I open a browser in a different computer, and try to access the project (ie. http://myserver/WebServices). The page doesn't display the TreePanel.
At this point, I don't know if it's a problem with the IIS itself, or another issue of configuration.
Here is my code:
Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<script type="text/javascript" language="javascript" >
function ShowLoadMask()
{
Ext.getCmp("Test_Tree").el.mask('Loading ...', 'x-mask-loading');
}
function HideLoadMask()
{
Ext.getCmp("Test_Tree").el.unmask();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<ext:ScriptManager ID="ScriptManager2" runat="server" CleanResourceUrl="False">
</ext:ScriptManager>
<ext:TreePanel ID="Test_Tree" runat="server" Header="false"
Border="false" AutoScroll="true" RootVisible="False" >
<Loader>
<ext:WebServiceTreeLoader DataUrl="TreeLoaderService.asmx/GetNodes" />
</Loader>
<Root>
<ext:AsyncTreeNode NodeID="0" Text="Root" Expanded="true" />
</Root>
<Listeners>
<BeforeLoad Handler="ShowLoadMask();" />
<Load Handler="HideLoadMask();" />
</Listeners>
</ext:TreePanel>
</form>
</body>
</html>
TreeLoaderService.cs
using System;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
[WebService(Namespace = http://tempuri.org/)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class TreeLoaderService : System.Web.Services.WebService {
[WebMethod]
public Coolite.Ext.Web.TreeNodeCollection GetNodes(string node)
{
int nodeID = Convert.ToInt32(node.ToString());
Coolite.Ext.Web.TreeNodeCollection nodes = new Coolite.Ext.Web.TreeNodeCollection();
if (!string.IsNullOrEmpty(node))
{
Coolite.Ext.Web.AsyncTreeNode asyncNode = new Coolite.Ext.Web.AsyncTreeNode();
asyncNode.Text = (nodeID + 1).ToString();
asyncNode.NodeID = asyncNode.Text;
asyncNode.Icon = Coolite.Ext.Web.Icon.UserAdd;
nodes.Add(asyncNode);
}
return nodes;
}
}
I hope that anybody can help me ...Best regards.