当前位置: 代码迷 >> ASP.NET >> URL重写有关问题,大家帮忙
  详细解决方案

URL重写有关问题,大家帮忙

热度:8642   发布时间:2013-02-25 00:00:00.0
URL重写问题,大家帮忙
在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重写,请大家帮忙!!


------解决方案--------------------------------------------------------
帮顶
------解决方案--------------------------------------------------------
最后我浏览页面点修,但页面不会URL重写,请大家帮忙!! 
??

应该浏览器地址中显示"../modify/"+dsORDER_INFO.Tables[0].Rows[i][0]+".aspx
  相关解决方案