Expand Minimize

SPC026901: Do not use inline code in ASPX pages

ASPX pages should not contain inline code. Use code behind instead.

CheckId SPC026901
TypeName DoNotUseInlineCodeInASPXPage
Severity CriticalWarning
Type Solution

Remove the inline code and use code behind instead. MSDN: Because inline code can run with full trust on the server, it is possible for a developer to expose data from anywhere in the SharePoint environment by making a call to elevate the privileges of the code during run time. As a best practice, any inline code should therefore be reviewed for security implications before it is allowed to be installed and run on the server.

To suppress this violation in XML SharePoint code add the following comment right before the XML tag which causes the rule violation. Learn more about SuppressMessage here.

<!-- "SuppressMessage":{"rule":"SPC026901:DoNotUseInlineCodeInASPXPage","justification":"Provide reason for suppression here"} -->
Disclaimer: The views and opinions expressed in this documentation and in SPCAF do not necessarily reflect the opinions and recommendations of Microsoft or any member of Microsoft. SPCAF and RENCORE are registered trademarks of RENCORE AB. All other trademarks, service marks, collective marks, copyrights, registered names, and marks used or cited by this documentation are the property of their respective owners.