Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>My problem is about InitializeSimpleMembership, because my all pages need login..</p> <p>Normally AccountController class has it;</p> <pre><code>[Authorize] [InitializeSimpleMembership] public class AccountController : Controller { .... </code></pre> <p>We need InitializeSimpleMembership all of our project.. So we create static class in App_Start folder: Exp;</p> <p>InitializeSimpleMembershipProviderConfig.cs</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Web; using WebMatrix.WebData; namespace OsosPlus2.UI { public class InitializeSimpleMembershipProviderConfig { public static void InitializeSimpleMembershipDbConnection() { if (!WebSecurity.Initialized) { WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "UserName", autoCreateTables: true); } } } } </code></pre> <p>After we created class, we write this codes into Global.asax;</p> <pre><code>InitializeSimpleMembershipProviderConfig.InitializeSimpleMembershipDbConnection(); </code></pre> <p>We have to delete this line under Filters folder</p> <pre><code>WebSecurity.InitializeDatabaseConnection("DefaultConnection", "UserProfile", "UserId", "UserName", autoCreateTables: true); </code></pre> <p>This answer translated from <a href="https://stackoverflow.com/users/1324756/aliriza-adiyahsi"><strong>AliRıza Adıyahşi</strong></a> 's answer from <a href="http://forum.yazgelistir.com/topic.aspx?topicid=25923&amp;siteid=0&amp;forumid=2#postContent89744" rel="nofollow noreferrer">yazgelistir.com</a></p> <p><em>THANKS FOR HIS HELP</em> <a href="https://stackoverflow.com/users/1324756/aliriza-adiyahsi"><strong>AliRıza Adıyahşi</strong></a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload