سؤال

أحاول إنشاء صفحة تسجيل دخول مخصصة ل SharePoint 2013. لدي مشروع جديد لعام 2010 يعمل بشكل جيد الذي أستخدمه كنموذج لإصدار 2013، لكنني لا أستطيع الحصول عليه للعمل. < / ص>

ما عملت هي جعل صفحتي الفارغة التي تعتمد على multiLogonPage، لكنني أحاول القيام بصفحة تسجيل دخول مدمجة (نموذج، إعادة توجيه Windows، إلخ). ويبدو أن الميراث من الصفحة الحالية لديه الكثير من القيود. على وجه الخصوص، يؤدي أي نوع من أنواع الرموز الرئيسية إلى:

غير صالحة بسبب الحالة الحالية للكائن. الوصف: حدث استثناء غير معالج أثناء تنفيذ طلب الويب الحالي. يرجى مراجعة تتبع المكدس للمزيد معلومات حول الخطأ وأين نشأت في التعليمات البرمجية.

تفاصيل الاستثناء: system.invalidoperationException: العملية ليست كذلك صالح بسبب الحالة الحالية للكائن.

خطأ المصدر:

استثناء غير معالج تم إنشاؤه أثناء تنفيذ طلب الويب الحالي. المعلومات المتعلقة بأصل وموقعه يمكن تحديد الاستثناء باستخدام تتبع المكدس الاستثناء أدناه.

Stack Trace:

[InvalentOperationException: العملية غير صالحة بسبب التيار حالة الكائن.]
microsoft.sharepoint.imentitymodel.pages.multilogonpage.onload (EventArgs. ه) +1118 system.web.ui.control.loadrecursive () +95
system.web.ui.page.processrequestmain (منطقية IncultestagesBeForeAsyNcPoint، Boolean IncludeAgeTimeNCPoint) +2936

ليست مشكلة Web.config، لأنه تم تعيينه للسماح لجميع المستخدمين في صفحة تسجيل الدخول.

أنا أفتقد شيئا ما في الإعداد الأساسي لكنني لا أعرف ماذا.

بالتأكيد يبدو من الأماكن مثل http://davidlozzi.com/2012/07/15/sharePoint-2012-2015-Create-Unique-Login-Page-With-Forms-Based-Authentication/ أن هذا بسيط جدا .. .

كل شيء في المنطقة الافتراضية الآن حتى لا يكون أي شيء حوله. يتم تعيين صفحة تسجيل الدخول بشكل صحيح لتطبيق الويب لأن إعادة التوجيه إلى صفحة تسجيل الدخول يحدث.

هل كانت مفيدة؟

المحلول

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 مع الإسناد
لا تنتمي إلى sharepoint.stackexchange
scroll top