I want to make Login page by using LINQ.
Can I use [Authorize] on controller? or How can I make authorization through database?
I want to make custom login page without web site administration tool because it does not provide more details.
Could you help me? I am really beginner MVC 3.
Please give your hands. Thanks.
Here is my Customer table. Can I use this table for authorization?
Thanks
public class Customer
{
[Key] public int customerId { get; set; }
public Boolean admin { get; set; }
public String userName { get; set; }
public String password { get; set; }
public String firstName { get; set; }
public String lastName { get; set; }
public String company { get; set; }
public String address { get; set; }
public String postCode { get; set; }
public String email { get; set; }
public String phone { get; set; }
public String sortCode { get; set; }
public String accountNo { get; set; }
public String cardHolder { get; set; }
public String cardNo { get; set; }
public int securityCode { get; set; }
}
Yes you can use
[Authorize]on your controller, or on individual actions to force the user to be authorized in order to use them.As you say you are new to MVC, I’d suggest that you have a look at the tutorials on the ASP.Net MVC web site. I believe The MVC Music Store example show you how to implement authorization etc.
You can also have a look at the Nerd Dinner project, which is a great way to get started and to have something that is working to play around with and to learn from.