将QueryString转换为常规Url [英] Convert QueryString to regular Url

查看:80
本文介绍了将QueryString转换为常规Url的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到一篇文章描述了如何将查询字符串转换为

没有查询字符串的Url并返回页面。


例如,此请求:

http:// www .mywebsite.com / products.as ... ry =主板


变成这样的:

http://www.mywebsite.com/motherboard.aspx


我需要这样做或类似的东西。问题是,我不能把这个文章放在我的手上。它本来可以是十几本b b b杂志,几十个网站或几十个时事通讯。我真的

希望我把它加了书签。如果有人能指出我的任何资源

描述这种技术我会非常感激。


问候,


David Taylor

解决方案

您是否可以对如何使这个

工作更具描述性?显然你可以做一些像


response.redirect(request.queryString(" category")&" .aspx")


但我觉得你想要多做一些事情

复杂。


-D


David C. Taylor <峰; dt ***** @ harc.edu>在留言中写道

news:d4 ************************** @ posting.google.c om ...

我看到一篇文章描述了如何将查询字符串转换为没有查询字符串的URL并返回页面。

例如,此请求:

http://www.mywebsite。 com / products.as ... ry =主板

变成这样的:

http://www.mywebsite.com/motherboard.aspx

我需要这样做或类似的东西。问题是,我不能把手放在那篇文章上。它本来可以是十几种杂志,几十个网站或几十种新闻通讯。我真的希望我已经给它添加了书签。如果有人能指出我描述这种技术的任何资源,我将非常感激。

问候,

David Taylor



您是否可以更加描述一下如何使这个

工作?显然你可以做一些像


response.redirect(request.queryString(" category")&" .aspx")


但我觉得你想要多做一些事情

复杂。


-D


David C. Taylor <峰; dt ***** @ harc.edu>在留言中写道

news:d4 ************************** @ posting.google.c om ...

我看到一篇文章描述了如何将查询字符串转换为没有查询字符串的URL并返回页面。

例如,此请求:

http://www.mywebsite。 com / products.as ... ry =主板

变成这样的:

http://www.mywebsite.com/motherboard.aspx

我需要这样做或类似的东西。问题是,我不能把手放在那篇文章上。它本来可以是十几种杂志,几十个网站或几十种新闻通讯。我真的希望我已经给它添加了书签。如果有人能指出我描述这种技术的任何资源,我将非常感激。

问候,

David Taylor



您可以使用request.RawURL()方法返回整个查询,然后使用

一些字符串函数来退出所有内容到? ;。


筹码


" David C. Taylor" <峰; dt ***** @ harc.edu>在留言中写道

news:d4 ************************** @ posting.google.c om ...

我看到一篇文章描述了如何将查询字符串转换为没有查询字符串的URL并返回页面。

例如,此请求:

http://www.mywebsite。 com / products.as ... ry =主板

变成这样的:

http://www.mywebsite.com/motherboard.aspx

我需要这样做或类似的东西。问题是,我不能把手放在那篇文章上。它本来可以是十几种杂志,几十个网站或几十种新闻通讯。我真的希望我已经给它添加了书签。如果有人能指出我描述这种技术的任何资源,我将非常感激。

问候,

David Taylor



I saw an article that described how to convert the query string into
an Url without a query string and return the page.

For example, this request:

http://www.mywebsite.com/products.as...ry=motherboard

becomes something like this:

http://www.mywebsite.com/motherboard.aspx

I need to do that or something like it. The problem is, I cannot put
my hands on that article. It could have been anywhere from a dozen
magazines, dozens of websites, or dozens of newsletters. I really
wish I had bookmarked it. If anyone can point me to any resources
describing this technique I would be highly appreciative.

Regards,

David Taylor

解决方案

Could you be a little more descriptive about how you are trying to get this
to work? Obviously you could do something like

response.redirect(request.queryString("category") & ".aspx")

but I have a feeling you are trying to do something a little more
complicated.

-D

"David C. Taylor" <dt*****@harc.edu> wrote in message
news:d4**************************@posting.google.c om...

I saw an article that described how to convert the query string into
an Url without a query string and return the page.

For example, this request:

http://www.mywebsite.com/products.as...ry=motherboard

becomes something like this:

http://www.mywebsite.com/motherboard.aspx

I need to do that or something like it. The problem is, I cannot put
my hands on that article. It could have been anywhere from a dozen
magazines, dozens of websites, or dozens of newsletters. I really
wish I had bookmarked it. If anyone can point me to any resources
describing this technique I would be highly appreciative.

Regards,

David Taylor



Could you be a little more descriptive about how you are trying to get this
to work? Obviously you could do something like

response.redirect(request.queryString("category") & ".aspx")

but I have a feeling you are trying to do something a little more
complicated.

-D

"David C. Taylor" <dt*****@harc.edu> wrote in message
news:d4**************************@posting.google.c om...

I saw an article that described how to convert the query string into
an Url without a query string and return the page.

For example, this request:

http://www.mywebsite.com/products.as...ry=motherboard

becomes something like this:

http://www.mywebsite.com/motherboard.aspx

I need to do that or something like it. The problem is, I cannot put
my hands on that article. It could have been anywhere from a dozen
magazines, dozens of websites, or dozens of newsletters. I really
wish I had bookmarked it. If anyone can point me to any resources
describing this technique I would be highly appreciative.

Regards,

David Taylor



You can use the request.RawURL() method to return the entire query, then use
some string functions to back out everything up to the "?".

Chip

"David C. Taylor" <dt*****@harc.edu> wrote in message
news:d4**************************@posting.google.c om...

I saw an article that described how to convert the query string into
an Url without a query string and return the page.

For example, this request:

http://www.mywebsite.com/products.as...ry=motherboard

becomes something like this:

http://www.mywebsite.com/motherboard.aspx

I need to do that or something like it. The problem is, I cannot put
my hands on that article. It could have been anywhere from a dozen
magazines, dozens of websites, or dozens of newsletters. I really
wish I had bookmarked it. If anyone can point me to any resources
describing this technique I would be highly appreciative.

Regards,

David Taylor



这篇关于将QueryString转换为常规Url的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆