.net 流氓
天下无难事,有志者成之;天下无易事,有恒者得之。

曾祥展

default.aspx.cs:

protected void Button1_Click(object sender, EventArgs e)
   {
       Response.Redirect("product/item=33");
   }
   protected void Button2_Click(object sender, EventArgs e)
   {
       Response.Redirect("Registration");
   }

 

曾祥展

点击商品 URL:http://localhost:3052/WebSite1/product/item=33

点击注册 URL:http://localhost:3052/WebSite1/Registration

 

 

1 <configuration
2   <configSections
3     <section name="urlrewritingnet"   
4              restartOnExternalChanges="true" 
5              requirePermission ="false"  
6              type="UrlRewritingNet.Configuration.UrlRewriteSection, 
7                    UrlRewritingNet.UrlRewriter"  /> 
8   </configSections
9 </configuration

 

 

 

1  <system.web
2     <httpModules
3      <add name="UrlRewriteModule" 
4          type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" /> 
5     </httpModules>     
6   </system.web

 

 

 

1 <urlrewritingnet rewriteOnlyVirtualUrls="true" contextItemsPrefix="QueryString" defaultPage="default.aspx" defaultProvider="RegEx" xmlns="http://www.urlrewriting.net/schemas/config/2006/07">
2       <rewrites>
3           <add name="RewriteOnDomain" virtualUrl="^http\://(.*)/product/item=(.*)" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/ProductDetails.aspx?productCode=$2" rewrite="Domain" ignoreCase="true"/>
4           <add name="Rewrite" virtualUrl="^http\://(.*)/Registration" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/Registion.aspx" rewrite="Domain" ignoreCase="true"/>
5       </rewrites>
6   </urlrewritingnet>
作者:曾祥展
出处:学无止境-博客园 (http://www.cnblogs.com/zengxiangzhan/)
posted on 2011-09-01 11:28  .net 流氓  阅读(181)  评论(0编辑  收藏  举报