隐藏网址扩展名 [英] Hide the URL extension
本文介绍了隐藏网址扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
海,
我正在使用vs2008,在我的应用程序中,我不想显示* .aspx页面扩展名.假设页面链接看起来像这样的"http://www.abc.com/products.aspx",则表示应显示为"http://www.abc.com/products/",仅.
我需要隐藏每个页面的扩展名..
该怎么做?
谢谢,
Sampath
Hai,
I am using vs2008 and in my application, I don''t want to show up the *.aspx page extension. suppose the page link looks like this "http://www.abc.com/products.aspx" means then, it should be display "http://www.abc.com/products/" only.
I need to hide the extension of the every page..
How to do that?
Thanks,
Sampath
推荐答案
我建议您两种解决方法:
1.使用MVC模式(推荐).示例: http://www.asp.net/mvc/tutorials/overview/understanding-models-views-and-controllers-cs [
I suggest you two solution:
1. Use MVC pattern (recommend). Example: http://www.asp.net/mvc/tutorials/overview/understanding-models-views-and-controllers-cs[^]
2. Every aspx file must be Default.aspx, and put into separated directory. Example:
-products.aspx => products/Default.aspx. Then in url just http://www.abc.com/products. It will execute Default.aspx without show Default.aspx.
嗨
使用asp.net的URL重写概念
http://msdn.microsoft.com/en-us/library/ms972974.aspx [ ^ ]
使用ASP.NET进行URL重写 [
Hi
Use URL Rewriting concept of asp.net
http://msdn.microsoft.com/en-us/library/ms972974.aspx[^]
URL Rewriting with ASP.NET[^]
Hope this will help :)
Thanks
您可以使用
网址路由 [ http://msdn.microsoft.com/en-us/magazine/dd347546.aspx [ [ ^ ]]
you can use
Url Routing [http://msdn.microsoft.com/en-us/magazine/dd347546.aspx[^]]
or you can re-write your url [Url Rewriting [^]]
这篇关于隐藏网址扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文