小弟我是这样在Web.Config中配置的,但是我如此配置的话就说无法找到该页.如果不是ajax(微软)的就能找到,请给个明灯
       <?xml version="1.0"?>
<configuration>
  <configSections>
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere" />
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication" />
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
    <!--
        UrlReWrite
    -->
    <section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter" />
  </configSections>  <connectionStrings>
    <add name="ConnectionString" connectionString="Data Source=.;Initial Catalog=LampsNet;User ID=sa;Password=181855" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  
  <appSettings>
    <add key="ConnectionString" value="server=.;uid=sa;pwd=181855;database=LampsNet"/>
  </appSettings>
  
    <RewriterConfig>
    <Rules>
      <RewriterRule>
        <LookFor>~/(\d+)\.html</LookFor>
        <SendTo>~/default2.aspx?id=$1</SendTo>
      </RewriterRule>      <RewriterRule>
        <LookFor>~/Master.htm</LookFor>
        <SendTo>~/MasterPage.aspx</SendTo>
      </RewriterRule>
    </Rules>    <Rules>
      <RewriterRule>
        <LookFor>~/(\d{4})/(\d{2})/(\d{2})\.html</LookFor>
        <SendTo>~/ShowBlogContent2.aspx?year=$1&amp;month=$2&amp;day=$3</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/(\d{4})/(\d{2})/Default\.html</LookFor>
        <SendTo>~/ShowBlogContent1.aspx?year=$1&amp;month=$2</SendTo>
      </RewriterRule>
      <RewriterRule>
        <LookFor>~/(\d{4})/Default\.html</LookFor>
        <SendTo>~/ShowBlogContent.aspx?year=$1</SendTo>
      </RewriterRule>      <!-- Rules for products lister -->
      <RewriterRule>
        <LookFor>~/Products/Baverage.aspx</LookFor>
        <SendTo>~/ListProductsByCategory.aspx?CategoryID=1</SendTo>
      </RewriterRule>      <!--<RewriterRule>
        <LookFor>~/([\w|\W]+)/([\w|\W]+)/(.[0-2]*)\.html</LookFor>
        <SendTo>~/result.aspx?Make=$1&amp;Place=$2</SendTo>
      </RewriterRule>-->      <RewriterRule>
        <LookFor>~/([\w|\W]+)/([\w|\W]+)/more\.html</LookFor>
        <SendTo>~/result.aspx?Make=$1&amp;Place=$2</SendTo>
      </RewriterRule>    </Rules>  </RewriterConfig>
  <system.web>
    <pages>
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </controls>
    </pages>
    <!--
          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="false">
      <assemblies>
        <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </assemblies>
    </compilation>    <httpHandlers>
      <remove verb="*" path="*.asmx"/>      <add verb="*" path="*.html" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
      <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 type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter" />
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>
  </system.web>  <system.web.extensions>
    <scripting>
      <webServices>
        <!-- Uncomment this line to customize maxJsonLength and add a custom converter -->
        <!--
      <jsonSerialization maxJsonLength="500">
        <converters>
          <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>
        </converters>
      </jsonSerialization>
      -->
        <!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->
        <!--
        <authenticationService enabled="true" requireSSL = "true|false"/>
      -->        <!-- Uncomment these lines to enable the profile service. To allow profile properties to be retrieved
           and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and
           writeAccessProperties attributes. -->
        <!--
      <profileService enabled="true"
                      readAccessProperties="propertyname1,propertyname2"
                      writeAccessProperties="propertyname1,propertyname2" />
      -->
      </webServices>
      <!--
      <scriptResourceHandler enableCompression="true" enableCaching="true" />
      -->
    </scripting>
  </system.web.extensions>  <system.webServer>
         ....................
  </system.webServer>
</configuration>

解决方案 »

  1.   

    你的问题我遇到过,教你一个简单的方法.
    先建一个AJAX网站,保存其配置文件.然后把ASP.NET配置文件中的部分节拷贝到这个配置文件里面,记住配置文件中的节点不要重复哦.只需要从ASP.NET配置文件中拷贝一点内容到AJAX网站配置文件就可以了,然后把这个AJAX网站的配置文件替换你要在ASP.NET网站中就可以了.我现在电脑上没电脑,不好意思.
    记得给分哦,给你打了这么多字.哈哈