URLRewriter能不能把规则放在XMl文件中
<Rules>
<RewriterRule>
<LookFor>~/Index.html</LookFor>
<SendTo>~/Index.aspx</SendTo>
</RewriterRule> <RewriterRule>
<LookFor>~/Index.html</LookFor>
<SendTo>~/Video/Video.aspx</SendTo>
</RewriterRule> <RewriterRule>
<LookFor>~/Img.html</LookFor>
<SendTo>~/Picture/Img.aspx</SendTo>
</RewriterRule>
</Rules>
如果可以 怎样写?? 注意:是URLRewriter哦
<Rules>
<RewriterRule>
<LookFor>~/Index.html</LookFor>
<SendTo>~/Index.aspx</SendTo>
</RewriterRule> <RewriterRule>
<LookFor>~/Index.html</LookFor>
<SendTo>~/Video/Video.aspx</SendTo>
</RewriterRule> <RewriterRule>
<LookFor>~/Img.html</LookFor>
<SendTo>~/Picture/Img.aspx</SendTo>
</RewriterRule>
</Rules>
如果可以 怎样写?? 注意:是URLRewriter哦
解决方案 »
- 这几句代码在infopath里面是干什么用
- 求一正则。default([0-9]+)-(\w+)-(\w+).html
- vs中的错误,求高手解答
- 三层架构中objectdatasource如何获取BLL层返回的值?
- 对数据库表进行更新需要作同步处理吗?
- 请帮我看下,这段代码要怎么改,在线等
- 各位大侠帮忙啊,怎么将两个DataSet的内容放在同一个DataGrid中显示,两个DataSet中的表的字段名是相同的
- 老问题:无法创建Web项目
- 提个简单问题隐藏代码
- 用VisualStudio.net2003建立的基于C#的Web应用程序能否进行绘图程序的编写???
- 请大家帮我看看
- 请问发布asp.net网站SQL2005中用设置什么吗?
<RewriterConfig configSource="configs\aNd1coder.UrlRewriter.config"></RewriterConfig>public static RewriterConfiguration ReadUrlRewriteFile()
{
XmlDocument xmldoc = new XmlDocument();
xmldoc.Load(HttpContext.Current.Server.MapPath("你的xml或Config文件路径"));
XmlNode section = xmldoc.LastChild;
XmlSerializer ser = new XmlSerializer(typeof(RewriterConfiguration));
return (RewriterConfiguration)ser.Deserialize(new XmlNodeReader(section));
}