我想显示我的域名的不同子网址。 [英] I want to display different sub url of my domain.

查看:90
本文介绍了我想显示我的域名的不同子网址。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好



我正在使用asp.net C#进行网络项目。



我想在网络浏览器中显示一个用户友好的网址,但是想根据我的搜索ID将其重定向到





For例如,假设用户写了一个网址www.abc.com/rock/stone。

但这应该重定向到www.abc.com/xyz.aspx?cat=rock&id=stone.

甚至在重定向网址后应显示为www.abc.com/rock/stone。



请帮我解决这个问题。



提前谢谢。

Hi there

I am working on a web project in asp.net C# .

I want to display a user-friendly url in the web browser but would like to redirect it
according to my search id.

For example lets say a user writes a url www.abc.com/rock/stone.
but this should be redirected to www.abc.com/xyz.aspx?cat=rock&id=stone.
and even after redirecting the url should be displayed as www.abc.com/rock/stone.

Please help me out with this issue.

Thanks in advance.

推荐答案

有两种相似或相关的不同方法。一个是 URL路由,另一个是 URL重写

http://msdn.microsoft.com/en-us/library/cc668201%28v=vs.100%29.aspx#aspnet_routing_versus_url_rewriting [ ^ ],

http://en.wikipedia.org/wiki/URL_rewriting [ ^ ]。



路由手册: http:// msdn .microsoft.com / zh-CN / library / cc668201%28v = vs.100%29.aspx [ ^ ]。



开重写: http://msdn.microsoft.com/en-us/library/ms972974.aspx [ ^ ]。



您将找到所需的一切。祝你好运,

-SA
There are two similar or related by different approaches. One is URL routing, another is URL rewriting:
http://msdn.microsoft.com/en-us/library/cc668201%28v=vs.100%29.aspx#aspnet_routing_versus_url_rewriting[^],
http://en.wikipedia.org/wiki/URL_rewriting[^].

The manual on routing: http://msdn.microsoft.com/en-us/library/cc668201%28v=vs.100%29.aspx[^].

On rewriting: http://msdn.microsoft.com/en-us/library/ms972974.aspx[^].

You will find all you need. Good luck,
—SA


hi,



使用网址路由。



查看以下链接:

------------------- -----------

使用ASP.NET 4.0进行URL路由 [ ^ ]



http://msdn.microsoft.com/en-us/library/cc668201%28v=vs.100%29.aspx [<一个href =http://msdn.microsoft.com/en-us/library/cc668201%28v=vs.100%29.aspxtarget =_ blanktitle =New Window> ^ ] < br $> b $ b

http://morewally.com/cs/blogs/wallym/archive/2008/10/08/asp-net-podcast-show-125-routing-with-webforms.aspx [ ^ ]


Use Url Routing.

Check following Links :
------------------------------
URL Routing with ASP.NET 4.0[^]

http://msdn.microsoft.com/en-us/library/cc668201%28v=vs.100%29.aspx[^]

http://morewally.com/cs/blogs/wallym/archive/2008/10/08/asp-net-podcast-show-125-routing-with-webforms.aspx[^]


这篇关于我想显示我的域名的不同子网址。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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