I’m trying to make a sign in page for Sharepoint 2010 using Forms Based Authentication.
I followed a tutorial and ended up with my project showing the above error (object not set to instance of an object).
[NullReferenceException: Object reference not set to an instance of an object.]
Microsoft.SharePoint.IdentityModel.Pages.FormsSignInPage.OnLoad(EventArgs e) +119
NDELogin.Layouts.NDELogin.Login.OnLoad(EventArgs e) +51
System.Web.UI.Control.LoadRecursive() +65
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2427
Would someone take a look at the Code/Aspx and tell me if you see anything wrong.
using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.IdentityModel.Pages;
namespace NDELogin.Layouts.NDELoginc
{
public partial class Login : FormsSignInPage
{
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
}
}
}
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Assembly Name="Microsoft.SharePoint.IdentityModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Import Namespace="Microsoft.SharePoint.WebControls" %>
<%@ Register Tagprefix="SharePoint"
Namespace="Microsoft.SharePoint.WebControls"
Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI"
Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs"
Inherits=" NDELogin.Layouts.NDELogin.Login, NDELogin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5da7e3f4f8be720c" MasterPageFile="~/_layouts/NDELogin/PublicMaster.master" %>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentLogin"
runat="server">
<SharePoint:EncodedLiteral runat="server"
EncodeMethod="HtmlEncode" ID="ClaimsFormsPageTitle"
Visible="false" />
<SharePoint:EncodedLiteral runat="server"
EncodeMethod="HtmlEncode" ID="ClaimsFormsPageTitleInTitleArea"
Visible="false" />
<SharePoint:EncodedLiteral runat="server"
EncodeMethod="HtmlEncode" ID="ClaimsFormsPageMessage"
Visible="false" />
<asp:Login ID="signInControl" FailureText="<%$Resources:wss,login_pageFailureText%>"
runat="server" Width="100%" DisplayRememberMe="false" />
</asp:Content>
I just answered my own question… set MembershipProvider=”FBAMembershipProvider” on the login control