How would I go about creating a web app login handler in C#?
In Java I would use a JSP that posts the username and password to a servlet, which then delegates to a POJO - for the db lookup and validation. If validation fails the servlet forwards onto the login.jsp for another attempt, if successfull then forwards to the secure resource.
Look into Forms Authentication.
Mainly, it's a terminology issue. Let me translate your Java to ASP.NET MVC:
In ASP.NET MVC, I would use an HTML view that posts the username and password to a Controller action, which then delegates to a POCO - for the db lookup and validation. If validation fails the Controller renders the Login view for another attempt, if successful then forwards to the secure resource.
And, to WebForms:
In ASP.NET WebForms, I would use a LoginControl that postbacks the username and password back to the Login.aspx codebehind, which then delegates to a POCO - for the db lookup and validation. If validation fails the Login.aspx page would be shown again for another attempt, if successful then redirects to the secure resource.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With