I have a simple static HTML site, renamed to ASPX, and then uploaded to SharePoint, see the procedure as described here:
This ASPX file works fine in two of my Teams- and SharePoint sites, respectively.
I can edit the ASPX file locally (via my OneDrive), and the changes will be uploaded and displayed correctly as web page in the browser.
However, this only works in two out of four of the Teams/SharePoint pages that I have tested it with, namely the two below named "T" and "TT", respectively, with green logos.
In the other two named "PA" and "A", respectively, the ASPX web page only works after the initial upload (after the website files have been copied over from one of the working sites, within SharePoint).
As soon as I edit the respective ASPX files locally, and after they are uploaded to "PA" or "A", respectively, they are not shown in the browser anymore. Instead, the browser downloads the ASPX file, as if Custom Scripts were not enabled.
What could be the reason that the ASPX file only works on some of my SharePoint sites and not on others?
Does the activation of Custom Scripts not apply to all my SharePoint pages, but must be activated separately for each SharePoint page?
Edit: I noticed that the ASPX files that don't work in the browser each have two occurrences of the following lines added to them, as soon as they are uploaded to SharePoint:
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=18.104.22.168, Culture=neutral, PublicKeyToken=[some long hex number]" %>
Why would this code only be added in the two SharePoint sites named "PA" and "A" as shown above, but not in the other two named "T" and "TT"?