Authorization error when accessing an aspx page
-
16-10-2019 - |
Question
I am using SharePoint Server 2007 Enterprise with Windows Server 2003 R2 Enterprise. I am developing using VSTS 2008 + C# + .Net 3.5 + IIS 6.0.
I have put a simple aspx page into layout folder (the code is very simple, just redirect to another page, and I write inline script code in asp.net), here is my code, and I met with unauthorized error (403) when I select to browse the page from IIS 6.0 manager.
I am not in Active Directory or Windows domain environment. I have enabled permission to anonymous users for the whole SharePoint site. Any ideas what is wrong?
<%@ Page Language="C#" AutoEventWireup="true" %>
<script runat="server" type="text/C#">
protected void Page_Load(object sender,EventArgs e)
{
Response.Redirect("http://www.google.com");
}
</script>
<html>
<body>
</body>
</html>
Solution
Possibly a permissions thing on the file system as a result of moving the file from some other location, which might have moved the original Access Control List along with that.
Try this:
- open notepad
- paste page contents into notepad
- save in layouts as a .aspx file