C # Как прочитать расположение шаблонов отображения в SharePoint 2013

sharepoint.stackexchange https://sharepoint.stackexchange.com//questions/67898

Вопрос

Sharpeoint 2013 имеет шаблон фильтра по умолчанию, расположенный по адресу:

_catalogs/masterpage/Display%20Templates/Filters/Filter_Default.js
.

Как я могу прочитать абсолютный путь Mechngage _Catalogs в C #?

Пример абсолютного пути: http://mymachine/_catalogs/masterpage/Display%20Templates/Filters/Filter_Default.js

Итак, если я загружу этот файл в элемент HTML-скрипта, я не буду получать 404 не найденную ошибку в браузере:

<script type="text/javascript" src="http://mymachine/_catalogs/masterpage/Display%20Templates/Filters/Filter_Default.js">
</script>
.

Это было полезно?

Решение

Why would you not use the fact that _catalogs is a virtual directory in SharePoint and reference it like this:

<scrit type="text/javascript" src="/_catalogs/15/masterpage/Display%20Templates/Filters/Filter_Default.js">
</script>

(notice the slash at first, and the 15 telling Sharepoint to look at the 15 hive instead of the 14 hive from 2010)

I also notice you have a typo in your "type" attribute (javscript instead of javascript)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top