Question

We have one aspx page uploaded in the Document Library with basic html tags(including html and body tag). when we try to open the aspx page it redirects to /_layouts/15/download.aspx page

we have also tried the setting- use the server default(open in browser)/Open in browser in the library advance settings and tried to upload the aspx page using the upload option instead of drag and drop.

Was it helpful?

Solution

What’s the permission of the user?

Make sure the user have "Add and Customize Pages permission" via checking permission in the site settings->site permissions->check permission.

If the issue still exists, how did you create the aspx page? Try to go to SharePoint Designer 2013 ->site pages->Page->create a new aspx page and check if it can be opened in the browser.

enter image description here

OTHER TIPS

If you put an ASPX file to a document library it will be downloaded when you click on it.

So, instead of the document library, you need to put your ASPX page to a different location. For example:

  • Site Assets
  • Styles Library
  • Site Pages

If you put your HTML Page (with an aspx extension) to any of the above, it will open just fine.

However, there is one caveat. By default, "Add And Customize Pages" right is denied on the modern site collections. This is why you have to disable this security feature before you can upload a custom ASPX page:

Install-Module -Name Microsoft.Online.SharePoint.PowerShell    
Connect-SPOService -Url https://tenant-admin.sharepoint.com 
Set-SPOSite -Identity https://tenant.sharepoint.com/sites/ModernTeam -DenyAddAndCustomizePages $false

enter image description here

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top