Hi, I'm a newbie to the Ajax Control Toolkit (50401) so I hope this isn't a stupid question! I have looked though the forum/FAQs and cannot find anything similar so any help would be appreciated.
I have written a very simple web page with a CollapsiblePanel based on the video tutorial. I am using Visual Studio 2010 with .NET 3.5. The page works correctly (ie expands and collapses) when I run it locally using the ASP.NET development server but not
when I publish to my hosted server (the page displays correctly but fails to expand/collapse). My host (1and1.co.uk) supports ASP.NET AJAX but only supports .NET 3.5 not 4. I have written another small AJAX web page and this works so I know they have ASP.NET
AJAX configured. AjaxControlToolkit.dll is being copied to the server in the /bin folder. Is there anything else I should be checking within VS2010 or on the server (bearing in mind being a hosted server I only have access to my webspace). My web.config, generated
by VS2010, and code are below in case it is relevant.
ian_lichfiel...
Member
25 Points
5 Posts
CollapsiblePanel not working on hosted server
Apr 14, 2011 05:07 PM|LINK
Hi, I'm a newbie to the Ajax Control Toolkit (50401) so I hope this isn't a stupid question! I have looked though the forum/FAQs and cannot find anything similar so any help would be appreciated.
I have written a very simple web page with a CollapsiblePanel based on the video tutorial. I am using Visual Studio 2010 with .NET 3.5. The page works correctly (ie expands and collapses) when I run it locally using the ASP.NET development server but not when I publish to my hosted server (the page displays correctly but fails to expand/collapse). My host (1and1.co.uk) supports ASP.NET AJAX but only supports .NET 3.5 not 4. I have written another small AJAX web page and this works so I know they have ASP.NET AJAX configured. AjaxControlToolkit.dll is being copied to the server in the /bin folder. Is there anything else I should be checking within VS2010 or on the server (bearing in mind being a hosted server I only have access to my webspace). My web.config, generated by VS2010, and code are below in case it is relevant.
Thanks, Ian
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="es_test2._Default" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxtoolkit" %> <!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>Ajax Control Toolkit Example</title> <link href="es.css" rel="stylesheet" type="text/css" /> </head> <body> <form id="form1" runat="server"> <p>AJAX Control Toolkit Collapsible Panel Extender Example</p> <ajaxtoolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </ajaxtoolkit:ToolkitScriptManager> <ajaxToolkit:CollapsiblePanelExtender ID="cpe" runat="Server" TargetControlID="Panel2" Collapsed="True" ExpandControlID="Panel1" CollapseControlID="Panel1" TextLabelID="Label1" ImageControlID="Image1" ExpandedImage="~/images/collapse.png" CollapsedImage="~/images/expand.png" SuppressPostBack="true"> </ajaxtoolkit:CollapsiblePanelExtender> <asp:Panel ID="Panel1" runat="server" CssClass="collapsepanelheader"> <asp:Image ID="Image1" runat="server" ImageUrl="images/expand.png" /> Panel Header <asp:Label ID="Label1" runat="server"></asp:Label></asp:Panel> <asp:Panel ID="Panel2" runat="server" CssClass="collapsepanel"> <p>This is my panel</p> </asp:Panel> </form> </body> </html><?xml version="1.0"?> <configuration> <configSections> <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/> <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> </sectionGroup> </sectionGroup> </sectionGroup> </configSections> <appSettings/> <connectionStrings/> <system.web> <!-- Visual Basic options: Set strict="true" to disallow all data type conversions where data loss can occur. Set explicit="true" to force declaration of all variables. --> <compilation debug="true" strict="false" explicit="true"> <assemblies> <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/> <add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> </assemblies> </compilation> <!-- The <authentication> section enables configuration of the security authentication mode used by ASP.NET to identify an incoming user. --> <authentication mode="Windows"/> <!-- The <customErrors> section enables configuration of what to do if/when an unhandled error occurs during the execution of a request. Specifically, it enables developers to configure html error pages to be displayed in place of a error stack trace. <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm"> <error statusCode="403" redirect="NoAccess.htm" /> <error statusCode="404" redirect="FileNotFound.htm" /> </customErrors> --> <pages> <namespaces> <clear/> <add namespace="System"/> <add namespace="System.Collections"/> <add namespace="System.Collections.Generic"/> <add namespace="System.Collections.Specialized"/> <add namespace="System.Configuration"/> <add namespace="System.Text"/> <add namespace="System.Text.RegularExpressions"/> <add namespace="System.Linq"/> <add namespace="System.Xml.Linq"/> <add namespace="System.Web"/> <add namespace="System.Web.Caching"/> <add namespace="System.Web.SessionState"/> <add namespace="System.Web.Security"/> <add namespace="System.Web.Profile"/> <add namespace="System.Web.UI"/> <add namespace="System.Web.UI.WebControls"/> <add namespace="System.Web.UI.WebControls.WebParts"/> <add namespace="System.Web.UI.HtmlControls"/> </namespaces> <controls> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </controls> </pages> <httpHandlers> <remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/> </httpHandlers> <httpModules> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </httpModules> </system.web> <system.codedom> <compilers> <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <providerOption name="CompilerVersion" value="v3.5"/> <providerOption name="OptionInfer" value="true"/> <providerOption name="WarnAsError" value="false"/> </compiler> </compilers> </system.codedom> <!-- The system.webServer section is required for running ASP.NET AJAX under Internet Information Services 7.0. It is not necessary for previous version of IIS. --> <system.webServer> <validation validateIntegratedModeConfiguration="false"/> <modules> <remove name="ScriptModule"/> <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </modules> <handlers> <remove name="WebServiceHandlerFactory-Integrated"/> <remove name="ScriptHandlerFactory"/> <remove name="ScriptHandlerFactoryAppServices"/> <remove name="ScriptResource"/> <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> </handlers> </system.webServer> <runtime> <assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/> </dependentAssembly> </assemblyBinding> </runtime> </configuration>XiaoCheng Fa...
All-Star
17743 Points
1414 Posts
Re: CollapsiblePanel not working on hosted server
Apr 18, 2011 10:19 AM|LINK
Hi,
Your codes looks fine to me. It seems that there should be some JavaScript errors when you view that page, can you post it?
I'm looking forward for your reply.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework
kctt
Contributor
5004 Points
948 Posts
Re: CollapsiblePanel not working on hosted server
Apr 20, 2011 02:52 AM|LINK
You should use Internet Explorer to view javascript error details.
Look at status bar and double click on js error for details.
ian_lichfiel...
Member
25 Points
5 Posts
Re: CollapsiblePanel not working on hosted server
Apr 20, 2011 08:42 PM|LINK
Hi, thanks for replying.
The code, as seen by my browser (IE9) is as follows:
<!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 id="Head1"><title> Ajax Control Toolkit Example </title><link href="es.css" rel="stylesheet" type="text/css" /></head> <body> <form name="form1" method="post" action="default.aspx" id="form1"> <div> <input type="hidden" name="ToolkitScriptManager1_HiddenField" id="ToolkitScriptManager1_HiddenField" value="" /> <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /> <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJOTg4ODc1OTAyZGQCbxnKcGke4N3CciYaG+6is9PDjg==" /> </div> <script type="text/javascript"> //<![CDATA[ var theForm = document.forms['form1']; if (!theForm) { theForm = document.form1; } function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } //]]> </script> <script src="/WebResource.axd?d=hWEC6fjIVA1oh-9s7cj7gA_B9rwDRcvh6-toY2m1HHvs5M54YAGaqjuh9SWw8vSDPZrvmO5QDEkR9nuXPmTBH3ft9-81&t=634208814757546466" type="text/javascript"></script> <script src="/ScriptResource.axd?d=u8rfFGX4uPWSbH-cBjJXDPg2sFizOJzx5Mg-m8iIiKmZM9qv6-jTepARzHzbEbyBmOIvT8RU3Q0GikqEVRjI5TMxOqsuNOrWgn_rcD5jAH6I4MBs0&t=ffffffffd2acd832" type="text/javascript"></script> <script src="/ScriptResource.axd?d=J460r-mHnmowTh7rISi649WlhqOw6uNbqYKKh06kPFyIUp8WA9207wsPxLxhb3NzgOJFIMnr4eL0DOc8xKbNTVaUn85Grc_zVLuEH1HwkSKpsemldI2MHTi-cFQ8LzpNQOqPPQ2&t=ffffffffd2acd832" type="text/javascript"></script> <script src="/default.aspx?_TSM_HiddenField_=ToolkitScriptManager1_HiddenField&_TSM_CombinedScripts_=%3b%3bAjaxControlToolkit%2c+Version%3d3.5.50401.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-GB%3abeac0bd6-6280-4a04-80bd-83d08f77c177%3af2c8e708%3ade1feab2%3a720a52bf%3af9cec9bc%3a4a2c8239" type="text/javascript"></script> <div> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAgLs/djgBQKBrveIBLmLSTMY3XZBOnrwWOpe6Vuer5EL" /> </div> <p>AJAX Control Toolkit Collapsible Panel Extender Example</p> <script type="text/javascript"> //<![CDATA[ Sys.WebForms.PageRequestManager._initialize('ToolkitScriptManager1', document.getElementById('form1')); Sys.WebForms.PageRequestManager.getInstance()._updateControls([], [], [], 90); //]]> </script> <input type="hidden" name="cpe_ClientState" id="cpe_ClientState" /> <div id="Panel1" class="collapsepanelheader"> <img id="Image1" src="images/expand.png" style="border-width:0px;" /> Panel Header <span id="Label1"></span> </div> <div id="Panel2" class="collapsepanel"> <p>This is my panel</p> </div> <script type="text/javascript"> //<![CDATA[ (function() {var fn = function() {$get("ToolkitScriptManager1_HiddenField").value = '';Sys.Application.remove_init(fn);};Sys.Application.add_init(fn);})();Sys.Application.initialize(); Sys.Application.add_init(function() { $create(Sys.Extended.UI.CollapsiblePanelBehavior, {"ClientStateFieldID":"cpe_ClientState","CollapseControlID":"Panel1","Collapsed":true,"CollapsedImage":"images/expand.png","ExpandControlID":"Panel1","ExpandedImage":"images/collapse.png","ImageControlID":"Image1","SuppressPostBack":true,"TextLabelID":"Label1","id":"cpe"}, null, null, $get("Panel2")); }); //]]> </script> </form> </body>I don't see any errors however if I start debugging I get the error:
(in other words the $create statement 5 lines from the end)
I'm afraid I'm still no wiser. Does this indicate a problem with web.config (shown in initial post) or is it irrelevant?
Thanks, Ian
ian_lichfiel...
Member
25 Points
5 Posts
Re: CollapsiblePanel not working on hosted server
Apr 21, 2011 09:59 AM|LINK
I have fixed it (or maybe it is just a workaround) by setting CombineScripts to false for the ToolkitScriptManager
<ajaxtoolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" CombineScripts="False"> </ajaxtoolkit:ToolkitScriptManager>Thanks, Ian