怎么隐藏网页的后缀名 比如有个网页地址是 good.aspx?id=12321&pid=718278 怎么隐藏.aspx 使网页地址变成
good?id=12321&pid=718278
good?id=12321&pid=718278
解决方案 »
- Asp.net MVC3 Ajax文件上传
- gridview下HyperLinkField传递多个参数的问题
- asp.net用了框架怎么在给按钮加CSS
- dropdownlist 添加值时如何确保没有重复的值?
- 服务器上的网站未装vs2005,只有IIS.在导出Excel表格时报错!
- 仅判断满足条件的记录是否存在,如何写最简程序?
- 万能查询会员升级,星星图标变多的功能如何实现(有半颗星的等级)
- 想求助,做一个ASP网站,具体细节如下
- 一般更新数据的时候,是直接用SQL语句,还是DATASET再返回数据源?
- 将dataSet的数据导出到Excel模板文件的问题?
- 紧急问题,正则表达式......................................
- Asp.net输出Excel文档直接下载时候遇到的问题
理论上可以,具体没有试过。
如<rewriter>
<rewrite url="~/news/([a-zA-Z]+).html$" to="~/Show.aspx?title=$1" processing="stop" />
</rewriter> <LookFor>~/news/([\w]+).html$ </LookFor>
<SendTo>~/Show.aspx?Title=$1 </SendTo>
LZ去看看URL重写吧
或者是
urlrouting这个组件在3.5中有,这个可以想ASP.NET MVC一样配置路由。
www.16sw.net
protected void btnClick_Click(object sender, EventArgs e)
{
string id = "asdsd";
string name = "123";
Response.Redirect("~/web/new/" + id + "/"+name+".html");
}
protected void Button1_Click(object sender, EventArgs e)
{
int id = 1;
Response.Redirect("~/web/new/" + id + ".html");
}
protected void Button2_Click(object sender, EventArgs e)
{
string id = "xiaoyunchao";
string name = "111";
}
<?xml version="1.0"?>
<!--
注意: 除了手动编辑此文件以外,您还可以使用
Web 管理工具来配置应用程序的设置。可以使用 Visual Studio 中的
“网站”->“Asp.Net 配置”选项。
设置和注释的完整列表在
machine.config.comments 中,该文件通常位于
\Windows\Microsoft.Net\Framework\v2.x\Config 中
-->
<configuration>
<!-- 手动添加 -->
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
</configSections>
<!-- 手动添加 -->
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/web/new/(.[\d]*).html</LookFor>
<SendTo>~/web/new.aspx?id=$1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/web/new/(.[\w]*)/(.[\w]*).html</LookFor>
<SendTo><![CDATA[~/web/new.aspx?id=$1&name=$2]]></SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
<httpModules>
<add name="ModuleRewriter" type="URLRewriter.ModuleRewriter, URLRewriter"/>
</httpModules>
</system.web>
</configuration>
webconfig里添加<configuration>
<!-- 手动添加 -->
<configSections>
<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
</configSections>
<!-- 手动添加 -->
<RewriterConfig>
<Rules>
<RewriterRule>
<LookFor>~/web/new/(.[\d]*).html</LookFor>
<SendTo>~/web/new.aspx?id=$1</SendTo>
</RewriterRule>
<RewriterRule>
<LookFor>~/web/new/(.[\w]*)/(.[\w]*).html</LookFor>
<SendTo><![CDATA[~/web/new.aspx?id=$1&name=$2]]></SendTo>
</RewriterRule>
</Rules>
</RewriterConfig>
从网上搜下 比较多 这里我就不多说了
那说说怎么静态化,本人正在找生成html的简单的代码,有写过,但还是不满意