如何创建用户友好的URL像计算器? [英] How do I create userfriendly urls like stackoverflow?

查看:199
本文介绍了如何创建用户友好的URL像计算器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建的堆栈溢出类型相似的URL创建一个问题时一样。

I want to create a similar type of url as stack overflow does when a question is created.

例如:

<一个href=\"http://stackoverflow.com/questions/1149454/\">http://stackoverflow.com/questions/1149454/non-ajax-get-post-using-jquery-plugin

我在我的大胆已经highlighed的最后部分特别感兴趣。你如何实现与分隔符添加页面的标题到URL的影响?

I am particularly interested in the last part which I have highlighed in bold. How do you achieve the affect of adding the title of the page to the url with the delimiter?

什么叫这种技术?

推荐答案

使用的 ASP.NET路由而不是可能的情况下改写。它的问世既MVC和Web窗体。路由更加灵活,通过上下文来处理code,处理回传,做一个更好的工作等。

Use ASP.NET routing rather than rewriting when possible. It's available with both MVC and Web Forms. Routing is much more flexible and does a better job in passing context to the processing code, handling postbacks, etc.

您也可以使用 IIS7重写模块来处理在Web服务器级别重写你的ASP.NET code执行之前。有一个关于如何在这里做到这一点一些好的信息

You can also use the IIS7 Rewrite Module to handle rewriting at the webserver level before your ASP.NET code executes. There's some good information on how to do that here.

这篇关于如何创建用户友好的URL像计算器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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