I am new in ASP.NET MVC4. I am creating a Empty MVC4 Project Template and trying to add ASP.NET Membership Provider into it but i am not understanding how can I do it. I am searching in Google but all demos are using Internet Application project template.
I know this question is not good but i am already spend two days for it.
Please give a some advice or tutorial for this purpose.
Update
According to Nesim Razon`s advice i copy and paste forms authentication sections to my empty project from a MVC4 Web Application (Internet Application template). But now i get an exception
To call this method, the "Membership.Provider" property must be an instance of "ExtendedMembershipProvider".
[InitializeSimpleMembership]
public class HomeController : Controller
{
public ActionResult Index()
{
WebSecurity.CreateUserAndAccount("Name", "Password"); // Exception is thrown from there.
return View();
}
}
I am also added the following directive in the Web.config file:
<add key="enableSimpleMembership" value="true" />
SimpleMembership
, which has some dependencies that are a bit of a pain to resolve in an empty project. Why not just create a default web project and remove what you're not using? – JumbleSimpleMembershipProvider
(to use things like OAuth) or the traditional legacySqlMembershipProvider
?? – Nonsectarian