I am attempting to for the first time create a custom asp.net website on a sharepoint web server, i have created the following Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" MasterPageFile="~/_layouts/application.master" %>
<%@ Assembly Name="Microsoft.SharePoint.ApplicationPages,Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<asp:Content ID="Content1" ContentPlaceHolderId="PlaceHolderMain" runat="server">
<div>
Title of this site: <asp:Label ID="LabelTitle" runat="server" Text="Label">
</asp:Label>
</div>
</asp:Content>
<asp:Content ID="Content2"
ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
Test ASP.NET 2.0 Application
</asp:Content>
with the following Default.aspx.cs
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Microsoft.SharePoint;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
SPWeb web = SPcontext.Current.Web;
LabelTitle.Text = web.Title;
}
protected override void OnPreInit(EventArgs e)
{
base.OnPreInit(e);
SPWeb web = SPContext.Current.Web;
String strUrl = web.ServerRelativeUrl + "/_catalogs/masterpage/default.aster";
this.MasterPageFile = strUrl;
}
}
I also commented out in the web.config, and I included the Microsoft.Sharepoint.dll as a reference in the project. I then dropped the entire folder under _layouts\TestWebsite\
However, when going to http://server/_layouts/TestWebSite/ I get a 'File not Found' error. Is there something I am missing or a setting that I should have skipped over?
Thanks.