I’m having an extremely difficult time trying figure how to implemented some type of way to use ASP includes in SharePoint 2010. If you can’t please please please help me with another way of doing so.
I found a solution, but I’m not completely happy with..
============HTML============
<div class="js-include" title="test.html"></div>
============JQUERY============
$(function () {
//Trigger global pages
$(".js-include").each(function(){
var inc=$(this);
$.get(inc.attr("title"), function(data){
inc.replaceWith(data);
});
});});
See The Case of Server Side Includes in Sharepoint Continued for an example of how to use the XML Web Part to duplicate in SharePoint what the
<!-- #include file -->directive accomplishes in ASP.However, as @PaulLeigh said, since SharePoint is built upon ASP.NET, I would highly recommend embracing Master Pages and user controls as replacements for ASP styled server side includes.