SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Probably a question with an obvious answer, but I'm lost. How do you add a custom aspx page (with code behind) to a project in visual studio 2008 for sharepoint 2007.

I've created the project using wspbuilder and have added a feature with receiver and other custom classes, but I find no way to add a custom page.

Any help?

ps. once I've added it, what will be the url of it?


Edit: I've created the folder structure suggested, but I can't find a Web Form in the list of items I can add to that folder. I've created the project as a WSPBuilder project. How can I install my missing templates

Edit2: Ok adding a new guid to the ProjectTypeGuids in the .csproj file I was able to add an aspx page at 12/template/layouts/UFeature/test.aspx

    <%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
    <%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
    <%@ Import Namespace="Microsoft.SharePoint" %>
    <%@ Page Language="C#"%>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <script runat="server">
    public static string output;
    protected void Page_Load(object sender, EventArgs e)
        SPUser user;
        output = "Ciao";
    <html xmlns="" >
    <head runat="server">
        <form id="form1" runat="server">

Now my problem is that it doesn't find SPUser even thought I've added the import of Microsoft.Sharepoint.

share|improve this question

You need to create the directory structure in your solution for WSPBuilder to package & deploy it correctly.

The structure will be something like:


Once you've got that, you can create new ASP.NET Web Forms in that folder, and they'll be deployed with the WSP.

The URL to access them will be something like


share|improve this answer
I can't find a Web Form in the list of items I can add to that folder – Maurizio Pozzobon Aug 22 '12 at 6:58
@MaurizioPz Try installing the CKSDev extention for VS, then it should appear. – Daniel Ziga Aug 22 '12 at 7:24
@Dandroid it seems to be for visual studio 2010, I'm on VS 2008 – Maurizio Pozzobon Aug 22 '12 at 7:44

Your Answer


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.