如何在asp.net中使用url路由? [英] how to use url routing in asp.net?

查看:54
本文介绍了如何在asp.net中使用url路由?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,

我想知道如何在asp.net c#中使用url路由概念。我有三个页面,即默认页面,主页和产品列表页面。在浏览器的网址中我需要重命名



http:// localhost /购物/ Default.aspx http:// localhost / Shopping / Login



http://localhost/Shopping/home.aspx http:// localhost / Shopping / Home



http://localhost/Shopping/productlist.aspx http:// localhost / Shopping / Products < br $> b $ b

请给我这个问题的解决方案.................

Hi sir,
I want to know how to use url routing concept in asp.net c#. I have three pages namely Default,home and productlist pages. In the url of the browser i need to rename

http://localhost/Shopping/Default.aspx to http://localhost/Shopping/Login
and
http://localhost/Shopping/home.aspx to http://localhost/Shopping/Home
and
http://localhost/Shopping/productlist.aspx to http://localhost/Shopping/Products

Kindly give me the solution for this problem.................

推荐答案

浏览以下文章以获取URL路由



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



一步一步提到一切。
Go through below article for URL routing

URL Routing with ASP.NET 4.0[^]

Everything is mentioned step by step.


你读过它了吗?一切都很好解释:

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



为了以防万一,还要注意URL重写: http ://msdn.microsoft.com/en-us/library/cc668201(v = vs.100).aspx #aspnet_routing_versus_url_rewriting [ ^ ]。



另请参阅: http://en.wikipedia.org/wiki/URL_rewriting [<小时ef =http://en.wikipedia.org/wiki/URL_rewritingtarget =_ blanktitle =New Window> ^ ]。



-SA
Did you read about it? Everything is well explained:
http://msdn.microsoft.com/en-us/library/cc668201%28v=vs.100%29.aspx#aspnet_routing_versus_url_rewriting[^].

Just in case, also pay attention for URL rewriting: http://msdn.microsoft.com/en-us/library/cc668201(v=vs.100).aspx#aspnet_routing_versus_url_rewriting[^].

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

—SA


这篇关于如何在asp.net中使用url路由?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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