原来做ajax都是在一个模板上改,今天新建了一个ajax,突然出现问题:
<add verb="POST,GET" path=" ajax/*.ashx"
type="Ajax.PageHandlerFactory, Ajax" />
</httpHandlers>
加上后运行,显示:
未能加载文件或程序集“Ajax”或它的某一个依赖项
又搜了半天,没找到答案,只好把原来的模板中的<httpHandlers>加上:
<httpHandlers>
<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="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>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
终于解决了,但是具体也搞不太清楚怎么回事,希望对你有用。