高手请进,关于url重写
我用了UrlRewrite技术,把地址变换了,但是有一种情况隐藏不了----利用datagrid生成的分页,当我点击下一页后,地址又恢复了原来的。网址是http://www.gdqd.com/c36.aspx,各位高手请问如何隐藏? 问题点数:50、回复次数:14Top
1 楼huwei2003(凡)回复于 2005-02-28 18:13:22 得分 0
关注。。。。。。。。Top
2 楼web_gus(树欲静而风不止)回复于 2005-02-28 19:05:24 得分 0
up
Top
3 楼GSXiaoXiao(牧羊人)回复于 2005-02-28 19:07:46 得分 0
upTop
4 楼ldljlq(越搞越不明白)回复于 2005-02-28 19:58:44 得分 0
要改动内核的一些处理流程才能真正的实现URL重写。
Top
5 楼saucer(思归)回复于 2005-03-01 02:52:24 得分 40
你是怎么做UrlRewrite的?DataGrid的分页是用PostBack实现的么?在IE里看看HTML源码,<form>里用的是原来的URL么?
你也许需要改写 Application_PreRequestHandlerExecute,把原来的URL写回去
HttpContext.Current.RewritePath(HttpContext.Current.Request.RawUrl);
Top
6 楼k98188()回复于 2005-03-01 09:44:35 得分 0
我是通过web.config来实现的,DataGrid的分页是用PostBack,原来的URL是class.aspx?classid=36
请问思归大哥,HttpContext.Current.RewritePath(HttpContext.Current.Request.RawUrl);代表什么意思?放在那里?具体应该怎么做?Top
7 楼saucer(思归)回复于 2005-03-01 09:53:51 得分 0
try to do it inside global.asax or its codebehind
void Application_PreRequestHandlerExecute(Object sender, EventArgs e)
{
//.....
}Top
8 楼Ivony(授人以鱼不如授人以渔,上海谋生)回复于 2005-03-01 09:55:09 得分 5
放在这里:
Application_PreRequestHandlerExecute
这个在Global.asax文件中。Top
9 楼Ivony(授人以鱼不如授人以渔,上海谋生)回复于 2005-03-01 09:55:58 得分 0
楼上的。。。。。。。留点分给晚辈们嘛。。。。Top
10 楼mymyal123(风之森)回复于 2005-03-01 10:00:36 得分 0
upTop
11 楼k98188()回复于 2005-03-02 02:00:45 得分 0
我改了Global.asax,但是由原来的http://www.gdqd.com/class.aspx?classid=36变成了http://www.gdqd.com/c36.aspx?classid=36,能不能只为http://www.gdqd.com/c36.aspx,后面的参数都不要,先谢谢:)Top
12 楼saucer(思归)回复于 2005-03-02 05:04:02 得分 0
just process the string like the following
string s = Request.RawUrl;
int n = s.IndexOf('?');
if (n >=0)
s = s.Substring(0,n);
HttpContext.Current.RewritePath(s);Top
13 楼k98188()回复于 2005-03-02 22:07:47 得分 0
我试了,改了,老是提示出错啊?Top
14 楼btut2004(养鱼炒股)回复于 2005-03-02 22:48:28 得分 5
http://community.csdn.net/Expert/TopicView.asp?id=3815557Top





