不AjaxControlToolkit中发布工作后。 ASP.net C#工作、AjaxControlToolkit、net、ASP

2023-09-10 21:16:33 作者:抗美援潮i

我写使用ASP.net和C#在Visual Studio 2010中的应用程序。我用我通过的NuGet安装AjaxControlToolkit中,它完美的作品在我的本地机器测试时。我的问题是,当我在网上发布的网站到我们的服务器,阿贾克斯不工作。 (下面两张图片。不能张贴在这里,因为我是一个新用户,但我已经得到了的photobucket链接。忽略的专辑名称,这是一个朋友的乐队name..Haha。)

这是什么样子,当我测试它在我的本地计算机上一样的图片。注意MaskedEditExtender在电话号码文本框,以及如何导航栏向上顶看上去;正常。 ( http://i16.photobucket.com/albums/b25/MenOpause_is_awesome/Page1。 PNG )

这是它的外观,当我在网上发布。该MaskedEditExtenders不要在电话号码文本框工作了,和我的导航栏是乱七八糟的某些原因。 ( http://i16.photobucket.com/albums/b25/MenOpause_is_awesome/ Page2-1.png )

我手动上传我的项目,它仍然AjaxControlToolkit中使用时,会产生相同的结果。以阿贾克斯完全出来,它看起来罚款我的本地计算机和发布的网站上;我只是没有所有的Ajax验证,我真的很喜欢用。如果需要,我可以为你提供我的code,但似乎我只是缺少一些目录或文件在上传过程中,还是有些事情不工作或没有设置正确。任何有识之士将大大AP preciated。谢谢你在先进的,让我知道,如果有我可以提供,如果你会知道原因的任何其他信息。

编辑(解决):我添加下面一行到我的web.config,其中固定资产一切显然,把它联机工作:

 <处理>
  <删除名称=AXD-ISAPI-4.0-64/>
  <删除名称=AXD-ISAPI-4.0/>
  <删除名称=AboMapperCustom-27080/>
  <删除名称=AboMapperCustom-27079/>
  <删除名称=AboMapperCustom-27078/>
  <删除名称=AboMapperCustom-27077/>
  <删除名称=AboMapperCustom-27076/>
  <删除名称=AboMapperCustom-27075/>
  <删除名称=AboMapperCustom-27074/>
  <删除名称=AboMapperCustom-27073/>
  <删除名称=AboMapperCustom-27072/>
  <删除名称=AboMapperCustom-27062/>
  <添加名称=AXD-ISAPI-4.0路径=* AXD。动词=GET,HEAD,POST,DEBUG模块=IsapiModulescriptProcessor ​​=C:\ WINDOWS \ Microsoft.NET \框架\ V4 .0.30319 \ aspnet_isapi.dll的资源型=未指定requireAccess =脚本preCondition =classicMode,runtimeVersionv4.0,bitness32/>
  <添加名称=AXD-ISAPI-4.0-64路径=* AXD。动词=GET,HEAD,POST,DEBUG模块=IsapiModulescriptProcessor ​​=C:\ WINDOWS \ Microsoft.NET \ Framework64 \ v4.0.30319 \ aspnet_isapi.dll的资源型=未指定requireAccess =脚本preCondition =classicMode,runtimeVersionv4.0,bitness64/>
  <添加名称=ScriptResourcepreCondition =integratedMode动词=GET,HEAD路径=的ScriptResource.axdTYPE =System.Web.Handlers.ScriptResourceHandler,System.Web.Extensions程序,版本为1.0 .61025.0,文化=中性公钥= 31bf3856ad364e35/>

< /处理器>
 
为什么本地做好的asp网站传到服务器会不能登录

解决方案

比较两者的配置文件,并确保它们匹配,当然,他们应该在不同的连接字符串取决于如果你使用某种类型的发展DB对的除外。

您可能会看到在Web配置文件中的一个组件标签在本地计算机上,并且必须是也对生产服务器上的Web配置文件。

您的组件会是这个样子:

 <组件>
            <添加组件=System.Design,版本= 4.0.0.0,文化=中性公钥= B03F5F7F11D50A3A/>
            <添加组件=System.Web.Extensions.Design,版本= 4.0.0.0,文化=中性公钥= 31BF3856AD364E35/>
            <添加组件=System.Windows.Forms的,版本= 4.0.0.0,文化=中性公钥= B77A5C561934E089/>
< /组件>
 

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>

解决方案

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>