日期:2014-05-18  浏览次数:20471 次

url如何重定向 请大家帮忙
我想把地址栏上的   "http://marry.inhe.net/Center/ShowNews/ShowNews.aspx?id=5033 "  
  在地址栏上显示为 "http://marry.inhe.net/Center/ShowNews/ShowNews.aspx/5033 "
  不知道如何实现   请大家帮助

------解决方案--------------------
脚本实现就可以了。

也可以使用transfer简单的实现
------解决方案--------------------
if(!IsPostBack)
{
if(Request.QueryString[ "id "]!=null&&Request.QueryString[ "id "]= "5033 ")
{
Response.Redirect( "http://marry.inhe.net/Center/ShowNews/ShowNews.aspx/5033 ");
}
}
------解决方案--------------------
if(!IsPostBack)
{
if(Request.QueryString[ "id "]!=null&&Request.QueryString[ "id "]= "5033 ")
{
Response.Redirect( "http://marry.inhe.net/Center/ShowNews/ShowNews.aspx/5033 ");
}
}
================================================
這樣
if(!IsPostBack)
{
if(Request.QueryString[ "id "]!=null)
{
Response.Redirect( "http://marry.inhe.net/Center/ShowNews/ShowNews.aspx/ "+Request.QueryString[ "id "].Trim());
}
}
------解决方案--------------------
晕,怎么会这样呢,我也一直想实现这样的效果,但我只实现了如下效果:
我想把地址栏上的 "http://marry.inhe.net/Center/ShowNews/ShowNews.aspx?id=5033 "
在地址栏上显示为 "http://marry.inhe.net/Center/ShowNews/5033.aspx "
------解决方案--------------------
通过自定义模块 捕捉request事件 可以实现
------解决方案--------------------
flysky862()的應該也可以這樣完成啊
if(!IsPostBack)
{
if(Request.QueryString[ "id "]!=null)
{
Response.Redirect( "http://marry.inhe.net/Center/ShowNews/ "+Request.QueryString[ "id "].Trim()+ ".aspx ");
}
}
------解决方案--------------------
搜索url重写,很多
微软有个可以下载的dll提供了这个功能,2.0可以直接在web.config 里面配置
------解决方案--------------------
请问 为什么要这么改?
把 "http://marry.inhe.net/Center/ShowNews/ShowNews.aspx?id=5033 " 改成
http://marry.inhe.net/Center/ShowNews/ShowNews.aspx/5033 "
有什么好处么?

------解决方案--------------------
wpfonline(无知) ( ) 信誉:100 2007-08-07 17:30:24 得分: 0


flysky862() ( ) 信誉:100
的那种怎么实现在 可以说一下吗??


——————————————————————————————————————————

我以前回果一个帖子:http://community.csdn.net/Expert/topic/5645/5645189.xml?temp=.6197473


我的其它部分回复可以看:http://www.google.com/advanced_search?q=sp1234+site:community.csdn.net&hl=zh-CN&lr=&newwindow=1&rls=com.microsoft:en-US&as_qdr=all

同样方法,可以看看别人的回复。