I uploaded an .aspx file (a simple HTML button with a mailto: link) to a document library on my SharePoint Online site, with the intention of putting it into an Embed web part on a separate page. This worked fine: The page now has an Embed web part that contains the button.

Here is the content of the original file (partially redacted for privacy reasons):

<center><button type="button" style="background-color:#004e8c"><a href="mailto:[REDACTED]?subject=[REDACTED]&body=[REDACTED]" style="color:white;font-size:160%;text-decoration:none">Submit Feedback</a></button></center>

Now, I want to make changes to the .aspx file. I uploaded a new version of the file to the same library. However, rather than working as expected, the new version has different behavior:

  • If I click on the newly uploaded .aspx file from the library, it downloads instead of rendering in my browser.
  • If I use the newly uploaded .aspx file as a target for my Embed web part, the button does not appear.
  • If I manually navigate to the URL of the newly uploaded .aspx file, I receive the following error message:

Sorry, something went wrong

File Not Found.

Debug Only Section Begins (visible in DEBUG builds or prodbubble)------------------ System.IO.FileNotFoundException: File Not Found. at Microsoft.SharePoint.ApplicationRuntime.SPVirtualFile.CalculateFileDependencies(HttpContext context, SPRequestModuleData basicRequestData, ICollection& directDependencies, ICollection& childDependencies) at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.EnsureDependencies(HttpContext context, SPRequestModuleData requestData) at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.EnsureCacheKeyAndViewStateHash(HttpContext context, SPRequestModuleData requestData) at Microsoft.SharePoint.ApplicationRuntime.SPDatabaseFile.GetVirtualPathProviderCacheKey(HttpContext context, SPRequestModuleData requestData) at Microsoft.SharePoint.ApplicationRuntime.SPVirtualPathProvider.GetCacheKey(String virtualPath) at System.Web.Compilation.BuildManager.GetCacheKeyFromVirtualPath(VirtualPath virtualPath, Boolean& keyFromVPP) at System.Web.Compilation.BuildManager.GetVPathBuildResultFromCacheInternal(VirtualPath virtualPath, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.HttpApplication.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() Debug Only Section Ends------------------


Troubleshoot issues with Microsoft SharePoint Foundation. Correlation ID: 5835c19f-d083-0000-d1f2-3eb51cd2d202

Date and Time: 4/23/2021 4:55:14 PM

I initially thought there must be something wrong with the new file I had uploaded, so I tried uploading an exact copy of the original file. No luck, same broken behavior, despite the files being exactly the same. I also tried uploading a file containing only <H1>Hello world</H1>, as suggested in the comments, but got the same results.

The original file still works, but I am hesitant to make any changes to it now, in case doing so will cause it to display this broken behavior as well.

How can I get a newly uploaded file to behave like the ones I uploaded before (open instead of downloading when clicked on, valid target for an Embed web part)?

  • 1
    1) What's inside the aspx file? 2) Can you upload a new ASPX file that contains only <H1>Hello world</H1> inside it? Apr 24 '21 at 2:59
  • @DenisMolodtsov 1) It's an <a> tag containing a mailto:link with some parameters (to, subject, body), wrapped in a <button> tag. I'd rather not post the full text because some of what's in the body parameter is business content. 2) Uploading the Hello World file results in the same broken behavior (downloads instead of opening, can't be embedded, error message if you navigate directly).
    – A_S00
    Apr 24 '21 at 16:37
  • 1) can you remove business-related content and then post the sample? 2) What do you mean by the "same broken behaviour"? If you are saying that the file is downloaded, it sounds like to totally different behavour. At least you are not getting an error any longer. To make sure ASPX files are rendered and not downloaded, check out this answer: sharepoint.stackexchange.com/questions/292438/… Apr 24 '21 at 16:44
  • @DenisMolodtsov Check the bullet point section of my post again. The broken behavior is 1) downloads instead of rendering when clicked from the library, 2) does not work as an Embed target, and 3) shows the error message from the post if you navigate to it directly (by typing its path and file name into your URL bar). This is exactly the same for the previous attempts, and for the Hello World file.
    – A_S00
    Apr 24 '21 at 16:52
  • 1
    have you checked if the DenyAddAndCustomizePages is set to false? Apr 24 '21 at 18:33

Your Answer

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

Browse other questions tagged or ask your own question.