我在这方面相当新,并且在部署我的网站时遇到问题(带有一些AJAX组件的ASP.net)并且一直在疯狂地试图找到解释。
通常一切都有一个例外,当从MS Access数据库中读取/更新/删除时,使用AJAX HTMLEditor的页面不起作用。我在页面上有其他AJAX控件(例如日历扩展器),它们似乎正常工作。我还有文本框的fiorms,它们都正确地更新了数据库。
我有两个运行IIS 7的测试环境,两者都可以正常工作。 Visual Studio2010开发测试也可以正常工作。
我怀疑问题出在IIS配置或web.config设置中。
任何帮助都会受到赞赏,我一直在寻找几天的答案,并且正在快速接近疯狂......
提前致谢。
这是当前使用IIS 7在我的测试服务器上运行的web.config。
<configuration>
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="CI1ConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source=|DataDirectory|CI1.mdb"
providerName="System.Data.OleDb" />
<add name="AppCtlConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source=|DataDirectory|CI1AppCtl.mdb"
providerName="System.Data.OleDb" />
<add name="SurveyConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source=|DataDirectory|CI1Surveys.mdb"
providerName="System.Data.OleDb" />
<add name="LogFileConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source=|DataDirectory|CI1SystemLogs.mdb"
providerName="System.Data.OleDb" />
</connectionStrings>
<system.web>
<httpRuntime requestValidationMode="2.0" requestPathInvalidCharacters="" />
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" validateRequest="false"
enableEventValidation="false" viewStateEncryptionMode="Never" enableViewStateMac="false" >
<controls>
<add tagPrefix="asp" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>
<httpModules>
<add name="EOWebRuntime" type="EO.Web.Runtime,EO.Web"/>
</httpModules>
<httpHandlers>
</httpHandlers>
<sessionState mode="InProc" timeout="120" />
<identity impersonate="false" />
<trust level="Full" />
<customErrors defaultRedirect="CTL_Problem.aspx" />
<compilation batch="true" batchTimeout="900" debug="true" defaultLanguage="c#" explicit="true" numRecompilesBeforeAppRestart="15" strict="false" targetFramework="4.0">
<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>
</compilation>
<globalization culture="en-AU" enableClientBasedCulture="true" uiCulture="en-AU" />
</system.web>
<system.net>
<mailSettings>
<smtp>
<network defaultCredentials="true" host="localhost" />
</smtp>
</mailSettings>
</system.net>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true" />
<defaultDocument>
<files>
<clear />
<add value="default.aspx" />
<add value="index.aspx" />
</files>
</defaultDocument>
</system.webServer>
<location path="Styles/Site.css">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="data">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
<location path="functions">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
</configuration>
好的我已经做了一些探索并更新了我的web.config(见下文)。现在,该行为使页面能够读取数据(不是每次都读取)并随机更新数据库(插入和更新)。非常奇怪的是,更新似乎在每次第二次尝试时起作用。
无论如何这里是新的web.config .....感谢您提供任何帮助。
<configuration>
<connectionStrings>
<remove name="LocalSqlServer" />
<add name="CI1ConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|CI1.mdb" providerName="System.Data.OleDb" />
<add name="AppCtlConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|CI1AppCtl.mdb" providerName="System.Data.OleDb" />
<add name="SurveyConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|CI1Surveys.mdb" providerName="System.Data.OleDb" />
<add name="LogFileConnectionString" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|CI1SystemLogs.mdb" providerName="System.Data.OleDb" />
</connectionStrings>
<system.web>
<httpRuntime requestValidationMode="2.0" requestPathInvalidCharacters="" />
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" validateRequest="false" enableEventValidation="false" viewStateEncryptionMode="Never" enableViewStateMac="false">
<controls>
<add tagPrefix="asp" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" />
</controls>
</pages>
<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="*" 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>
<httpModules>
<add name="EOWebRuntime" type="EO.Web.Runtime,EO.Web" />
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</httpModules>
<sessionState allowCustomSqlDatabase="true" cookieless="UseCookies" mode="SQLServer" sqlCommandTimeout="600"
sqlConnectionString="Data Source=tcp:s05.winhost.com;Initial Catalog=DB_25270_blackrobot;User ID=DB_25270_blackrobot_user;Password=itstime2work;Integrated Security=False;" timeout="120">
</sessionState>
<identity impersonate="false" />
<trust level="Full" />
<customErrors defaultRedirect="CTL_Problem.aspx" />
<compilation batch="true" batchTimeout="900" debug="true" defaultLanguage="c#" explicit="true" numRecompilesBeforeAppRestart="15" strict="false" targetFramework="4.0">
<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>
</compilation>
<globalization culture="en-AU" enableClientBasedCulture="true" uiCulture="en-AU" />
</system.web>
<system.net>
<mailSettings>
<smtp>
<network defaultCredentials="true" host="localhost" />
</smtp>
</mailSettings>
</system.net>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true" >
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<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>
<urlCompression doDynamicCompression="true" />
<rewrite>
<rules>
<rule name="cwme.org.au" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^(www.)?cwme.org.au" />
<add input="{PATH_INFO}" pattern="^/Amna/" negate="true" />
</conditions>
<action type="Rewrite" url="\Amna\{R:0}" />
</rule>
</rules>
</rewrite>
<defaultDocument>
<files>
<clear />
<add value="default.aspx" />
<add value="index.aspx" />
</files>
</defaultDocument>
</system.webServer>
<location path="Styles/Site.css">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<location path="data">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
<location path="functions">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
</configuration>
答案 0 :(得分:1)
ARGH我找到了问题并解决了它。经过详尽的研究后发现,我宿主的资源分配已经用尽了。升级了托管计划,将分配的内存增加了一倍,问题就解决了!
再多100美元,比心理医生便宜很多!