开发者

ASP.NET AJAX 1.0 Windows Server 2k8

I am trying to deploy a .NET 2.0 ASP.NET application with AJAX 1.0 on a Windows Server 2008 system running IIS 7.

The same application that runs perfectly on my development machine, but when published and deployed it won't run AJAX, even though no error messages are displayed. Asynchronous calls will just refresh the entire page (the same symptom described here, but my xhtmlConformance tag is set to Transitional). The absence of any errors and messages proves that the AJAX library was found and successfully added to the project.

I've read some posts on this subject, and supposedly there are some tweaks on web.config that should make it work, but after following some of them, I had no success.

I've added every additional tag available on this sample web.config file to my running web.config.

This application was not originally created as an "AJAX-enabled ASP.NET Application", but as a regular ASP.NET application, although it works perfectly while on my development environment.

Question: What should I do to run a .NET Framework 2.0 ASP.NET application with AJAX 1.0 on Windows Server 2k8 with IIS 7 ?


Before it's suggested: I do want to update it to the newest version of the .NET Framework, and that's being worked on, but I'm not the one makin开发者_开发问答g calls regarding subjects like this..


Update:

Trying to access /ScriptResource.axd (with the proper querystrings) gives me the following error:

Session state is not available in this context.


It turns out that the issue I added on the update to the question was what caused the whole problem.

Ajax tried to access /ScriptResource.axd, and it ran a method on global.asax that accessed a session variable when in fact there was no session.

All I had to do is to check if the session is available before using it on Global.asax, as follows:

if (HttpContext.Current.Session!=null)
{
   // my code
}

The solution was found on this blog.


You've installed ASP.NET AJAX 1.0 on the server, and you have System.Web.Extensions added to your web.config? I'm not sure how well it works bin-deployed with your app. Before we migrated to ASP.NET 3.5, we used to install ASP.NET AJAX 1.0 using the Windows Installer package.

At a minimum you need:

<compilation debug="false" defaultLanguage="c#">
  <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

But Microsoft shows a complete file here: ASP.NET AJAX 1.0 Web.config File Contents

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜