Fix ASPX Files Downloading Instead of Rendering in SharePoint Online
Question details
Users uploading ASPX files to SharePoint Online experience an issue where the files are downloaded to their local machine rather than opening and rendering directly in the web browser.

- Product
- SharePoint Online
- Device & OS
- not provided
- Scenario
- Accessing or opening uploaded ASPX web pages from a SharePoint document library.
- Observed behavior
- The ASPX file triggers a standard file download prompt instead of displaying its web content within the browser.
Ensure you have SharePoint Administrator or Global Administrator privileges, as modifying custom script settings requires administrative access.
Enable Custom Scripts in the SharePoint Admin Center
Allowing custom scripts across your tenant resolves the rendering issue, as SharePoint blocks ASPX execution by default for security.
By default, custom scripts are blocked on modern user-created sites associated with Microsoft 365 groups. Enabling this feature globally allows ASPX pages to render properly instead of downloading.
Log in to the Microsoft 365 admin center and navigate to the SharePoint admin center.
In the left navigation pane, click on 'Settings', then scroll to the bottom and select the 'Classic settings page' link.
Scroll down to the 'Custom Script' section on the classic settings page.
Select the options 'Allow users to run custom script on personal sites' and 'Allow users to run custom script on self-service created sites'.
Click 'OK' at the bottom of the page to save your new configuration.

Enable Custom Scripts via SharePoint Online Management Shell
Use PowerShell to immediately enable custom scripts for a specific SharePoint site rather than changing the policy for the entire tenant.
Enhance Your Document Workflow with WPS Office
While SharePoint handles your web pages and team sites, WPS Office provides a free, lightweight, and powerful alternative for managing all your standard office documents. Enjoy full compatibility with Microsoft Office formats without the heavy subscription fees.
- 1. Download and Install: Visit the official WPS website to download the free WPS Office suite and follow the quick installation prompts.
- 2. Open Your Documents: Launch WPS Office and directly open your existing Word, Excel, and PowerPoint files with zero formatting loss.
- 3. Edit and Save: Use the familiar tools to edit your documents and save them in their original Microsoft Office formats.

Frequently Asked Questions
Why does SharePoint block ASPX files from rendering by default?
Microsoft blocks custom scripts, including uploaded ASPX files, by default on modern SharePoint sites to enhance security and prevent malicious code from executing within the browser.
Can I host independent IIS ASPX pages in SharePoint Online?
No, SharePoint Online does not generally execute uploaded ASPX files as independent IIS pages because it lacks the standard IIS backend host environment required for complex web forms.
How long does it take for custom script settings to apply?
If changed via the SharePoint Admin Center graphical interface, it can take up to 24 hours to take effect. Using PowerShell applies the change almost immediately to the specified site.




