如何使用ASP.net路由,使URL友好 [英] How to use ASP.net Routing to make url friendly

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

问题描述

我有以下页面:

Default.aspx
find_provider.aspx --> (has a search which takes the user to each provider page) --> provider.aspx?id={####}
news.aspx --> (has links to each news) --> article.aspx?id={####}
health.aspx --> (has links to each event) --> event.aspx?id={####}
patinfo.aspx --> (has links to each info) --> info.aspx?id={####}

虽然页面很容易记住,但不是ID。

Although the page are easy to remember but not the ID.

例如,在 find_provider.aspx 在执行搜索时,有三种结果,这需要到 provider.aspx 页,每一个独特的ID(在未来更多的附加):

For example, in the find_provider.aspx when a search is performed, there are three results which takes to provider.aspx page, each with a unique ID (with more added in the future):

Bolt, John MD --> provider.aspx?id=90
Barry, Brent MD --> provider.aspx?id=1090
Carson, John MD --> provider.aspx?id=10

如何建立我的网站,我的定义每个页面的ID将是什么使得它的用户和搜索友好?

How can I set up my web site where I an define what each page's ID will be for making it user and search friendly?

例如:

Bolt, John MD --> provider.aspx/johnbolt
Barry, Brent MD --> provider.aspx/brentbarry
Carson, John MD --> provider.aspx/johncarson

此外,同为 article.aspx event.aspx info.aspx 等等...

我使用的CMS晔,而不是一个MVC中的后台,如果它有助于了解。

I am using Ektron CMS and not a MVC in the backend, if it helps to know.

我看着ASP.net路由,但不知道如何实现它,因为我完全新的这一进程。

I looked into ASP.net Routing but wasn't sure how to implement it as I am totally new to this process.

推荐答案

当你正在使用晔,你尝试过使用别名功能?这使得在CMS内创建友好的URL。有不同类型的缴费走样,请参阅<一个href=\"http://documentation.ektron.com/cms400/v9.10/Reference/Web/EktronReferenceWeb.html#URL_Aliasing/URL_Aliasing.htm\"相对=nofollow>这里以获取更多信息。

As you are using Ektron, have you tried using the aliasing feature? This allows for friendly URLs to be created within the CMS. There are different types of aliasing avaiable, please see here for more information.

有可能通过为用户创建一个自动别名规则以创建友好的别名到用户的个人资料。

It is possible to create friendly aliases to a user's profile by creating an Automatic Aliasing rule for Users.

另外,你可以使用Smartforms储存关于你提供商的信息。如果是这样,你可以通过映射规则要么你的文件夹结构或分类法建立自动为别名的内容。

Alternatively, you may be using Smartforms to store information about your Providers. If so, you can create Automatic Aliases for Content by mapping a rule to either your folder structure or a taxonomy.

您可以在自己的工作区在这里所有这些设置:设置>配置>网址别名。默认情况下别名均已关闭,因此你需要使您可以在网址别名部分中的设置页所需的别名类型。

You can find all these settings in your Workarea here: Settings > Configuration > URL Aliasing. By default aliases are turned off so you will need to enable the alias types you require in the Settings page within the URL Aliasing section.

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

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