Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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>
share|improve this question

1 Answer 1

up vote 2 down vote accepted

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:

  1. open notepad
  2. paste page contents into notepad
  3. save in layouts as a .aspx file
share|improve this answer
2  
I'll second that, except its probably a MOVE not a COPY. When you move files in NTFS the rights move with them (classic deployment error that will tear down your entire site if you do it with the wrong XSLT file for example ;-) Another thing: consider doing code in codebehind instead of inline code. The safe mode parser in sharepoint allows inline code in application pages, but anywhere else its prohibited. Check out this article from AC: andrewconnell.com/blog/articles/… –  Anders Rask Dec 16 '09 at 12:11
1  
cool, thanks for clarifying Anders :) –  Jaap Vossers Dec 16 '09 at 12:25
1  
Have updated my answer –  Jaap Vossers Dec 16 '09 at 12:28
    
I want to check by default, to access aspx pages by anonymous users in layout folder, there should not be any authorization issues? –  George2 Dec 17 '09 at 16:25
1  
I believe this is true, assuming your site is set to allow anonymous access AND you do not have any file system access issues. Did the suggested steps solve your problem? –  Jaap Vossers Dec 17 '09 at 17:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.