I am creating a code behind file for the site page of sharepoint. The following page directive was used
<%@ Assembly Name="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>
<%@ Page Language="C#" CodeBehind="MyCustPage.cs" Inherits="CustPage.MyCustPage, CustPage, Version=1.0.0.0, Culture=neutral, PublicKeyToken=44ba9bb23d3f44ca" MasterPageFile="~masterurl/default.master" meta:progid="SharePoint.WebPartPage.Document" %>
<%@ Import Namespace="Microsoft.SharePoint.WebPartPages" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
My .cs file is as follows
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
namespace CustPage
{
public class MyCustPage:Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("<script>alert('it worked')</script>");
}
}
}
I am getting this error :
The base type 'CustPage.MyCustPage' is not allowed for this page. The type is not registered as safe.
I have only done two things : first create an aspx file and then a separate class library. Any help would be appreciated