2011-08-18 64 views
0

我爲我的web應用程序配置了FBA,該應用程序可以使用默認登錄頁面正常工作。所以我想爲該應用程序創建custonm登錄頁面。爲此,我創建了一個自定義登錄頁面。但是當我輸入證書時,它給我一個錯誤,如下所示。如何爲FBA應用程序添加自定義登錄頁面

Server Error in '/' Application.

Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
LdapContosoAuthentication.Layouts.LdapContosoAuthentication.LoginCustmCntrlPage.Button1_Click(Object sender, EventArgs e) +193
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +114
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +139
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +28
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2980

誰能告訴我怎麼解決這個錯誤?

回答

0

將您的自定義頁面放在佈局文件夾中,並進行以下更改。所以,你可以打開你的自定義登錄頁面:

<authentication mode="Forms"> 
    <forms loginUrl="/_layouts/CustomLogin.aspx" /> 
</authentication> 

是否已進行了login.aspx的頁面的委託控制(登錄控制)是否有變化?

相關問題