Monday, March 26, 2012

ASP.net Ajax Accordion issues


I am new to asp.net and rebuilding some websites using Visual Studio Web Developer edition. I created a right column that includes the ajax accordion panels following the tutorials on asp.net website. They are working flawlessly when previewing in the browser using VS's asp.net development server but when I try viewing the page via IIS using my local development server or our production server the accordion panels do not work. You click on the link to activate the panel and it just sits there and does nothing. Located in the left hand windows of IE says Done, but with errors. It gives me a line number but does not correspond to the line numbers in my code. Also not sure if this has anything to do with it, but the accordion panels are loaded up in a content section, I am using a master page.

Thanks for any assistance or suggestions,

Gym

just giving it a try. Is all dll's required for accordion to work present in your dev server or prod server. can you post what error does IE show you?. is it working with any other browser like firefox?

Thanks,


The dll's should be the AjaxControlKit and the System.Web.Extensions correct located in my bin folder? They are located in the same directory as the site files. Also I tried moving the bin folder to the root of the IIS server, i.e. Inetpub/WWW. Also it does not work in other browsers like FF.

Error from IE:

Line: 292
Char: 1
Error: 'Sys' is undefined
Code: 0
URL: http://localhost/work/new/

If you need any further information, please feel free to ask and I can post anything else that would pertain to the issue.

Best Regards,

Gym


looks like you are missing ajax extensions 1.0 installed in prod or dev server. pls install them. it is not sufficient if you have them in bin folder.

Thanks,


Yes, it is installed on both servers. I have also un-installed and reinstalled it. I downloaded the sample accordion script from the site and it produces the same results. Been searching the net for hours and really at a lost. It has to be something on the server side as I am able to run all of the accordion examples from other sites. :(


Hi,

Thank you for your post!

Please ckeck out the following link:

http://weblogs.asp.net/chrisri/archive/2007/02/02/demystifying-sys-is-undefined.aspx

In that article,Chris Riccio give youseveral reasons why the error appears:

1. The browser fails to load the compressed script

This is usually the case if you get the error on IE6, but not on other browsers.

The Script Resource Handler – ScriptResource.axd compresses the scripts before returning them to the browser. In pre-RTM releases, the handler did it all the time for all browsers, and it wasn't configurable. There is an issue in one of the components of IE6 that prevents it from loading compressed scripts correctly. See KB articlehere. In RTM builds, we've made two fixes for this. One, we don't compress if IE6 is the browser client. Two, we've now made compression configurable. Here's how you can toggle the web.config.

How do you fix it? First, make sure you are using the AJAX Extensions 1.0 RTM release. That alone should be enough. You can also try turning off compression by editing your web.config to have the following:

<system.web.extensions>
<scripting>
<scriptResourceHandler enableCompression="false" enableCaching="true" />
</scripting>
</system.web.extensions>

2. The required configuration for ScriptResourceHandler doesn't exist for the web.config for your application

Make sure your web.config contains the entries from the default web.config file provided with the extensions install. (default location: C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025)

3. The virtual directory you are using for your web, isn't correctly marked as an application (thus the configuration isn't getting loaded) - This would happen for IIS webs.

Make sure that you are using a Web Application, and not just a Virtual Directory

4. ScriptResource.axd requests return 404

This usually points to a mis-configuration of ASP.NET as a whole. On a default installation of ASP.NET, any web request to a resource ending in .axd is passed from IIS to ASP.NET via an isapi mapping. Additionally the mapping is configured to not check if the file exists. If that mapping does not exist, or the check if file exists isn't disabled, then IIS will attempt to find the physical file ScriptResource.axd, won't find it, and return 404.

You can check to see if this is the problem by coipy/pasting the full url to ScriptResource.axd from here, and seeing what it returns

<script src="http://pics.10026.com/?src=/MyWebApp/ScriptResource.axd?[snip - long query string]" type="text/javascript"></script>

How do you fix this? If ASP.NET isn't properly installed at all, you can run the "aspnet_regiis.exe" command line tool to fix it up. It's located in C:\WINDOWS\Microsoft.Net\Framework\v2.0.50727. You can run "aspnet_regiis -i -enable", which does the full registration of ASP.NET with IIS and makes sure the ISAPI is enabled in IIS6. You can also run "aspnet_regiis -s w3svc/1/root/MyWebApp" to only fix up the registration for your web application.

If you have further questions,let me know.

Best Regards,

No comments:

Post a Comment