I need to make a quick Sitecore admin script to inspect a series of items. I need to do this without compiling my solution. I made a sample ASPX page under /sitecore/admin/ using:

<script runat="server" language="text/c#">

but when I try to view it I get Sitecore telling me ItemNotFound.

Is this type of 'pure script' page supported under Sitecore? Is there a piece of functionality I am missing?

  • Adding this as a comment as it's not an answer to your specific question, but if you haven't already I would strongly recommend you investigate the Sitecore Powershell Extensions module. Once installed on your Sitecore instance, this will allow you to run scripts to inspect / interact with items without requiring compilation. It's perfect for those sort of admin tasks but does lots more too!
    – Kasaku
    Commented Oct 13, 2016 at 16:18

3 Answers 3


I wasnt extending the adminpage base class. My script tag should have read like this:

<%@ Page Language="c#" Inherits="Sitecore.sitecore.admin.AdminPage" %>

There a good writeup and example page in this post on BrainJocks.


If Sitecore is telling you ItemNotFound, then it's trying to resolve your request to a content item. Being your admin page is a physical file, the issue is most likely that you've not included the file extension in the request.

For example, to access the ShowConfig admin page I must include the aspx extension of the file when I request it:


If I leave the aspx off, I'll get an ItemNotFound error.


Here you go, sample code snippet for that:

<%@ Page Language="c#" EnableEventValidation="false" AutoEventWireup="true" %>

<script runat="server">
    void Page_Load(object sender, System.EventArgs e)

    public IEnumerable<string> Names
            return new[] { "1", "2" };

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <title>Example Admin page</title>
    <form runat="server">
            <asp:Repeater ID="repValues" runat="server" DataSource="<%# Names %>">
                    <%# (Container.DataItem as string) %>
                    <br />

EDIT: I am glad that you solved your issue ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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