Ajax无法与ASP.NET 2.0的Godaddy共享托管一起使用,什么是解决方案? [英] Ajax is not working with godaddy shared hosting for ASP.net 2.0, what is solution?

查看:51
本文介绍了Ajax无法与ASP.NET 2.0的Godaddy共享托管一起使用,什么是解决方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在使用godaddy.com的Windows托管,并且正在使用ajax 1.0在asp.net 2.0 bu中进行我的项目.但是ajax不能在那儿托管,当我在我的项目中实现AJAX时就会出现内部服务器错误".

其实我的Bin文件夹中有一个Ajax dll,我是从web.config文件中调用我的bin dll.以下是我的文件:

hii there,

i am using windows hosting of godaddy.com and i am making my project in asp.net 2.0 bu using ajax 1.0 . But ajax is not working in there hosting, when i implement AJAX in my project then "Internal server error" comes.

Actually i have ajax dll in my Bin folder , and i am calling my bin dll from web.config file. Following is my file :

<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
  <configsections>
  
  </configsections>
  <appsettings>
    <!--<add key="constring" value="Server=localhost;Database=xxxx;uid=xxxx;" />-->
    <add key="constring" value="Data Source=xxxx;Initial Catalog=xxxx;User ID=xxxx;Password=xxxxxx" />
    <add key="constring1" value="Data Source=xxxx;Initial Catalog=xxxx;User ID=xxxx;Password=xxxx" />
    </appsettings>
  <connectionstrings>
    
  <system.web>

    <httphandlers>
      <add verb="GET" path="FtbWebResource.axd" type="FreeTextBoxControls.AssemblyResourceHandler,FreeTextBox" />
      <remove verb="*" path="*.asmx" />
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />

    </httphandlers>
    <!--<pages>
      <controls>
        <add tagprefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
      </controls>
    </pages>-->
    <customerrors mode="Off" />
    
    <!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        -->
    <compilation debug="true">
      <assemblies>
        <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </assemblies>
    </compilation>
    <httphandlers>
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="true" />
    </httphandlers>

   

   

   
    <!--
            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>
        -->
  </customerrors></authentication></system.web>
 

</connectionstrings></configuration>




实际上问题仅存在于具有以下代码的web.config文件中:




Actually Problem is only in web.config file with following code :

<httpHandlers>
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="true"/>
    </httpHandlers>





当我删除此代码时,不会出现错误;当我删除此代码时,则将出现内部服务器错误.而且此代码对于使用ajax是必要的.在没有此代码的本地主机上,ajax停止工作.

我也和哥达分享了这个问题,他们回答:


ASP.NET AJAX程序集(System.Web.Extensions.dll)安装在全局程序集缓存(GAC)中.不要将程序集包含在启用AJAX的网站的Bin文件夹中.


我们已经对托管帐户进行了明确的测试,并且可以看到AJAX和服务器端包含程序正常运行.看来问题出在您的web.config文件中,因为当我们禁用此文件时,不再存在任何错误.


请任何人尝试解决我的这个问题,或者告诉我我必须在web.config文件中为ajax写什么代码.





when i removes this code then error doesnot comes , when i puts this code then Internal server error comes. And this code is neccesary for using ajax. At localhost without this code ajax stops working.

I have also shared this problem with godaddy and they replied :


ASP.NET AJAX assembly (System.Web.Extensions.dll) is installed in the global assembly cache (GAC). Do not include the assembly in the Bin folder of your AJAX-enabled website.


We have tested the hosting account explicitly and we are able to see that AJAX and Server side includes are working without issue. It appears that the issue is coming from your web.config file as when we disable this file any errors are no longer present.


Please any one try to solve my this problem , or tell me what code i have to write in web.config file for ajax .

推荐答案

他们给了你答案:您需要重新阅读和/或要求他们进行澄清,因为您不了解他们告诉您的内容.

提示:您需要2个Web.config副本-一个用于本地,一个用于GoDaddy.
They''ve given you the answer: you need to read it again and/or ask them for clarification as you do not understand what they have told you.

Hint: you need 2 copies of Web.config - one for local and one for GoDaddy.


这篇关于Ajax无法与ASP.NET 2.0的Godaddy共享托管一起使用,什么是解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆