我正在尝试为SharePoint 2013创建一个自定义登录页面。我有一个现有的2010项目,它可以很好地工作,即我使用的是2013年版本的模型,但我无法达到工作。< / p>

工作是什么,使我自己的空白页面是基于多功能多功能页面的,但我正在尝试执行合并的登录页面(表单,Windows重定向等)。似乎从现有页面继承有很多限制。特别是任何类型的主要码次导致:

由于对象的当前状态,操作无效。 描述:执行期间发生未处理的异常 当前的Web请求。有关更多信息,请查看堆栈跟踪 有关错误的信息,它源自代码。

例外详细信息:system.InvalidOperationException:操作不是 由于对象的当前状态而有效。

源错误:

在执行期间生成未处理的异常 当前的Web请求。关于起源和位置的信息 可以使用下面的异常堆栈跟踪来识别异常。

堆栈跟踪:

[InvalidOperationException:由于当前,操作无效 对象的状态。

Microsoft.SharePoint.identityModel.pages.pages.pages.pultilogonpage.onload(Eventargs. e)+1118 system.web.ui.control.loadRecursive()+95
system.web.ui.page.processrequestmain(布尔值 IncludeStagesBeforeAsyncPoint,Boolean IncludeStagesAfterAsyncPoint) +2936

它不是web.config问题,因为它设置为允许登录页面上的所有用户。

我显然缺少基本设置中的东西,但我不知道什么。

当然看起来像 http://davidlozzi.com/2011/07/15/sharepoint-2010-create-unique-login-page-with-forms-based-authentication/ 这很简单.. 。

一切都在默认区域现在,所以它没有任何东西。登录页面正确设置为Web应用程序,因为重定向到登录页面正在发生。

有帮助吗?

解决方案

I basically gave up and threw away what I had, starting over with http://davidlozzi.com/2011/07/15/sharepoint-2010-create-unique-login-page-with-forms-based-authentication/. The key I think is inheriting from the Forms sign-in page, but that's still squirrelly. I'd rather know exactly what that class is doing that lets it work but I don't have time to dig into it and replicate it.

其他提示

That error seems to occur when you attempt to use a CodeFile (aspx.cs) with a Page that inherits from Microsoft.SharePoint.IdentityModel.Pages.MultiLogonPage.

The error doesn't come up when you use compiled code or use CodeBehind and place the aspx.cs page in the App_Code directory.

You can also get rid of the error by removing base.Onload() from your overrided OnLoad method.

 protected override void OnLoad(EventArgs e)
    {
        //base.OnLoad(e);
    }

If you do this, the page title and text in front of the drop down list asking you to select an authentication method does not show up.

However, the drop down list is still added to the page and is still functional.

The MultiLogonPage is meant for allowing the user to select from a drop down list of login types and forward the user to the appropriate login type based off the postback from the drop down list.

Not quite sure why the error only occurs when trying to use a CodeFile, but there are ways to get it working, as I mentioned.

许可以下: CC-BY-SA归因
scroll top