AjaxControlToolkit not working after publish. ASP.

2019-07-27 09:57发布

I am writing an application in Visual Studio 2010 using ASP.net and C#. I'm using the AjaxControlToolkit which I installed through Nuget, and it works perfectly when testing on my local machine. My question is, when I publish the website online to our server, ajax doesn't work. (Two pictures below. Couldn't post them in here since I'm a new user, but I've got the photobucket links. Ignore the album name, it was a friend's band name..Haha.)

This is a picture of what it looks like when I test it on my local computer. Notice the MaskedEditExtender in the "Phone Number" text box, and how the Navigation bar up top looks; normal. (http://i16.photobucket.com/albums/b25/MenOpause_is_awesome/Page1.png)

This is how it looks when I publish it online. The MaskedEditExtenders don't work in the "Phone Number" textbox anymore, and my Navigation bar is all messed up for some reason. (http://i16.photobucket.com/albums/b25/MenOpause_is_awesome/Page2-1.png)

I've uploaded my project manually and still it yields the same results when using AjaxControlToolkit. Taking Ajax out entirely, it looks fine on my local machine and on the published website; I just don't have all the Ajax validations that I would really like to use. I can provide you with my code if needed, but it seems like I'm just missing some directory or file in the upload process, or something just isn't working or not set up right. Any insight would be greatly appreciated. Thank you in advanced and let me know if there's any other information I can provide if you might know the reason.

EDIT (SOLVED): I added the following line to my web.config, which fixed everything apparently and had it working online:

 <handlers>
  <remove name="AXD-ISAPI-4.0-64" />
  <remove name="AXD-ISAPI-4.0" />
  <remove name="AboMapperCustom-27080" />
  <remove name="AboMapperCustom-27079" />
  <remove name="AboMapperCustom-27078" />
  <remove name="AboMapperCustom-27077" />
  <remove name="AboMapperCustom-27076" />
  <remove name="AboMapperCustom-27075" />
  <remove name="AboMapperCustom-27074" />
  <remove name="AboMapperCustom-27073" />
  <remove name="AboMapperCustom-27072" />
  <remove name="AboMapperCustom-27062" />
  <add name="AXD-ISAPI-4.0" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
  <add name="AXD-ISAPI-4.0-64" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness64" />
  <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

</handlers>

2条回答
甜甜的少女心
2楼-- · 2019-07-27 10:39

Compare both config files and make sure they match, except of course where they should differ in connection strings depending on if you're using some type of development DB.

You'll probably see an assemblies tag on the web config file on your local machine and that needs to be also on your web config file on the production server.

Your assemblies would look something like this:

<assemblies>    
            <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
            <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
查看更多
爱情/是我丢掉的垃圾
3楼-- · 2019-07-27 10:39

This is somewhat of a guess, but if it's not in web.config and not in the code, it could be a mismatch of items in the bin directory.

I use the ajax framweork, and my bin directory has all these resource dlls.

enter image description here

查看更多
登录 后发表回答