在webconfig里我是这样配置的
<?xml version="1.0"?>
<!-- 
    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>
    <section   name="RewriterConfig"   type="URLRewriter.Config.RewriterConfigSerializerSectionHandler,   URLRewriter"   />
  </configSections>
  <RewriterConfig>
    <Rules>
      <!--   Rules   for   Blog   Content   Displayer   -->      <RewriterRule>
        <LookFor> ~/modify/(.[0-9]*)\.aspx </LookFor>
        <SendTo> ~/modify/modifyOrders.aspx?ORDERS_ID=$1 </SendTo>
      </RewriterRule>
    </Rules>
  </RewriterConfig>
<system.web>
<!-- 
            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"/>
<!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
<authentication mode="Forms"/>
<!--
            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>
        -->
    <globalization 
                requestEncoding="utf-8" 
                responseEncoding="utf-8" 
   />
    <httpHandlers>
      <add verb="*" path="*.aspx" type="URLRewriter.RewriterFactoryHandler, URLRewriter" />
    </httpHandlers>
  </system.web>  <appSettings>
    <add key="SQLConnection" value="uid=sa;pwd=sa;server=127.0.0.1;database=CpmmUserDB"/>
    <add key="Service.WebMethod" value="http://localhost/CPMM_LEVEL2/WebMethod.asmx"/>
  </appSettings>
</configuration>
然后在搜索页面上,我是这样写的
<a href=\"../modify/"+dsORDER_INFO.Tables[0].Rows[i][0]+".aspx\">修</a>最后我浏览页面点修,但页面不会URL重写,请大家帮忙!!

解决方案 »

  1.   

    最后我浏览页面点修,但页面不会URL重写,请大家帮忙!! 
    ??应该浏览器地址中显示"../modify/"+dsORDER_INFO.Tables[0].Rows[i][0]+".aspx
    而实际页面为~/modify/modifyOrders.aspx?ORDERS_ID=$1吧
      

  2.   

     ~/modify/(.[0-9]*)\.aspx只能完全字符替换吧,不能用正则表达式这个url重写太弱,没多大作用
      

  3.   

    不能用正则表达式,只能一个一个对应。

    modify/1.aspx  modify/modifyOrders.aspx?ORDERS_ID=$1
    modify/2.aspx  modify/modifyOrders.aspx?ORDERS_ID=$2
      

  4.   

    dsORDER_INFO.Tables[0].Rows[i][0]取出来的是数字吗?符合你的正则吗?
      

  5.   

    最后我浏览页面点修,但页面不会URL重写,请大家帮忙!! --------------
    问题说的不是很清楚,重写就是你访问~/modify/(.[0-9]*)\.aspx  ,会显示 ~/modify/modifyOrders.aspx?ORDERS_ID=$1页的内容,而不是你访问后者转向到后者。
      

  6.   

    对啊,我是访问~/modify/(.[0-9]*)\.aspx,但显示不了~/modify/modifyOrders.aspx?ORDERS_ID=$1页上的内容,而且是找不到该页面
      

  7.   

    不好意思,我搞错了,我用过的是    <urlMappings>
          <add url="~/modify/1.aspx " mappedUrl="~/modify/modifyOrders.aspx?ORDERS_ID=$1 
    " />
          <add url="~/modify/1.aspx " mappedUrl="~/modify/modifyOrders.aspx?ORDERS_ID=$2 
    " />
         </urlMappings>
    功能太差
      

  8.   

    应该可能还是iis或者web.config配置的问题
      

  9.   

    iis也得配置吧?
    百度一下,网上有配置详解
      

  10.   

    IIS要配一下的,就是把那个检查物理页面是否存在的勾要去掉的,否则它会认为你找不到该页面