将 ASP.Net 3.5 SP1 路由与 SharePoint 2007 结合使用
我正在尝试在 SharePoint 网站上设置一些友好的 URL。 我知道我可以使用 RewritePath 实现 ASP.Net 2.0 友好 URL,但我想知道是否可以使用 ASP.NET 3.5 SP1 附带的 System.Web.Routing。
我想我已经弄清楚如何加载路由表,但我不清楚使用什么方法来传递正确的 IHttpHandler。
谢谢!
I'm trying to setup some friendly URLs on a SharePoint website. I know that I can do the ASP.Net 2.0 friendly URLs using RewritePath, but I was wondering if it was possible to make use of the System.Web.Routing that comes with ASP.NET 3.5 SP1.
I think I've figured out how to get my route table loaded, but I'm not clear on what method to use to get the correct IHttpHandler to pass out.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我被要求将此视为 Share Point 评估流程的一部分。
我的理解是,uri 模板本质上是主机名,后跟递归文件夹结构。
Share Point 将 uri 截断为 255 个字符,这使情况变得更加复杂。 因此,如果您有特别深或冗长的文件夹结构,那么您的 uri 可能会变得无效。
我正在考虑通过遵循人类可读的约定并转换为共享点约定来美化/整理 uri。 即:
http://myhostname.com/ docs/ human-resources/case-files/2009/reviews/ed-blackburn.docx
转换为共享点:
http://myhostname.com/ human%20resources/case%20files/2009/reviews/ed%20blackburn.docx
任何其他所需服务都可以由控制器控制。
如果长度超过 255 个字符,我最初建议使用某种tinyurl 方法。
I've been asked to look at this as part of an Share Point evaluation process.
My understanding is that the uri template is essentially host name followed by the recursive folder structure.
This is further complicated by Share Point truncating the uri at 255 characters. So if you have a particularly deep or verbose folder structure then your uri can become invalid.
I was thinking about essentially prettifying / tidying up the uri by follow a human readable convention and convert to the Share Point convention. i.e:
http://myhostname.com/docs/human-resources/case-files/2009/reviews/ed-blackburn.docx
converts to Share Points:
http://myhostname.com/human%20resources/case%20files/2009/reviews/ed%20blackburn.docx
Any additional required services can be controlled by the controller.
If longer than 255 characters some kind of tinyurl approach would be my initial suggestion.
我最终选择了 Ryan 拥有的:
这对我来说似乎没问题。
I ended up taking what Ryan had:
That seems to work ok for me.
它应该像下面一样简单。
然后在 web.config 中的 HTTP 模块下注册 System.Web.Routing.UrlRoutingModule 就可以了。
It should be as easy as the below.
Then register System.Web.Routing.UrlRoutingModule under HTTP modules in web.config and you should be good to go.