4

I'm beginner developer for SharePoint-Online. I want to know what is the best practice of extension of my pages in sharePoint hosted addin.

a) .aspx extension b) .html extension c) .htm extension

enter image description here

Thank you previously, this is really helpful for me :)

6

.html and .htm are absolutely identical.

In terms of apps there is no difference if you are creating .aspx or .html.
But you need to consider your requirements carefully. For example, if you need to host on your page some OOB web parts, for example XSLTListViewWebPart:

<WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="full" Title="loc:full">
            <WebPartPages:XsltListViewWebPart runat="server" ListUrl="Lists/Faq" IsIncluded="True"
                NoDefaultStyle="TRUE" Title="XsltListView web part" PageType="PAGE_NORMALVIEW"
                Default="False" ViewContentTypeId="0x">
            </WebPartPages:XsltListViewWebPart>
</WebPartPages:WebPartZone>  

this is possible only in aspx page. If you need to put into your page any other SharePoint controls - you need aspx.

From the other side, aspx adds some html and js overhead in markup. If all above is not your requirement, and you are building modern angular (react) SPA application, for simplicity you can go ahead with .html.

From my perspective, it's safer and better to always use .aspx, because in future you may have a requirement to include some OOB controls into your existing page. In that case with '.html' you will be stucked. If you are building react\angular, just put markup inside <asp:Content ContentPlaceHolderID="PlaceHolderMain" runat="server">.

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.