色尼玛亚洲综合影院,亚洲3atv精品一区二区三区,麻豆freexxxx性91精品,欧美在线91

.NET重寫URL淺談

最近小項(xiàng)目要求重寫url找了下資料用到了MS的2個(gè)dll,微軟的例子寫得太不明顯了。后來終于改好了。

ActionlessForm.dll------用來處理回發(fā)

URLRewriter.dll----- 是微軟封裝好了的一個(gè)URL重寫組件

添加引用----

具體的使用說明請去看

http://msdn.microsoft.com/zh-cn/library/ms972974.ASPx#XSLTsection123121120120

比我說得好得多。

具體使用方法:

首先web.config的配置:

<?xml version="1.0"?>
<configuration>
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectio
Handler,URLRewriter"
/>
</configSections>
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/ListCategories/.ASPx</LookFor>
<SendTo>~/Default.ASPx</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/(/d+)/.html</LookFor>
<SendTo>~/Cover.ASPx?id=$1</SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<system.web>
<httpModules>
<add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter"/>
</httpModules>
<compilation debug="true"/>
</system.web>
</configuration>

NET技術(shù).NET重寫URL淺談,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 敦化市| 廊坊市| 邯郸县| 上栗县| 四子王旗| 长治市| 宕昌县| 元阳县| 屏东县| 安陆市| 桐城市| 太湖县| 洛隆县| 察雅县| 高清| 山阴县| 玛多县| 霍山县| 斗六市| 左贡县| 汉阴县| 山阴县| 离岛区| 平陆县| 铁岭县| 盐城市| 尚义县| 东山县| 抚州市| 平山县| 门头沟区| 许昌县| 旌德县| 南充市| 晋城| 苏尼特右旗| 资兴市| 故城县| 喀喇沁旗| 剑川县| 乌海市|