Creating custom URL tokens in ASP.NET (a la MOSS)

杀马特。学长 韩版系。学妹 提交于 2019-12-04 19:16:31

It may not be the only place, but SPUtility.GetServerRelativeUrlFromPrefixedUrl() will parse URLs with ~site and ~sitecollection. MOSS also provides SPUrlExpressionBuilder for declarative use:

<link runat="server" rel="stylesheet" type="text/css"
      href="<% $SPUrl:~SiteCollection/Style Library/MyStyles/style.css %>" />

I don't know for sure - but I'd bet that code is buried in one of the SharePoint HTTPModules or HTTPHandlers that run for every request.

I don't think it would be there since it is not a universal token replaced anywhere in the output of the handler. It happens at the URL resolution level in a server control, which makes me think it might have been somewhere in the classes related to control building or parsing, but I did not find anything there.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!