我正在尝试使用基于表单的身份验证为 Sharepoint 2010 制作登录页面。我遵循了一个教程,最后我的项目显示了上述错误(对象未设置为对象的实例)。
[NullReferenceException:对象引用未设置为对象的实例。] 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(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint) +2427
有人会看一下代码/ Aspx 并告诉我您是否发现任何问题。
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>