0

With Java jsps, there is a very powerful and useful action tag for content reuse called include - <%include file="filename" %> which includes the file at runtime. This action allow for the passing of parameters. (Do not confuse action tag with the directive - <%@ include file="display.jsp" %> - which runs at time of translation. This would apply at a master or page template level.)

For example a welcome message that is used on many sites and not in a DB. Place it in an html file, have the aspx page "include" it, attach the aspx page to a webpart on the pages where the message is to appear.

Is there an aspx equivalent that can be use on an aspx page that would would bring in various html fragments? Something simple like the shtml ?

-1

You need to enable the publishing features, to get the Reusable Content list created at the root of your site collection. This list allows you to create usable fragments that can then be used in your pages.

Here are links to some helpful information:
http://en.share-gate.com/blog/sharepoint-reusable-content-a-forgotten-beauty
https://support.office.com/en-us/article/Use-reusable-content-867896D1-D2A9-41A0-8EC1-45EA17DA3DD2?ui=en-US&rs=en-US&ad=US&fromAR=1

I've used this in several publishing sites over the years and it works great.

  • Eric, Thanks. Not sure what that means, newbie to SP and at the client end and this sounds like a server setting or maybe it's a DB setting. I was hoping for something simple that could be added to an aspx page. I seem to remember long ago @renderpage(path to page) but I believe that require the external file to odd extensions like cshtml. Maybe only applied to asp before asp.net. I can not image that SP does not support something like this. Thanks for your response – PianoMan Jun 9 '16 at 3:16
  • updated with a couple helpful l inks on the topic. – Eric Alexander Jun 9 '16 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.