ASP.NET MVC - Navigation Approach -
I have ASP New to MVC My background is in ASP.NET web form, I think this is causing my confusion. I understand that "M" basically represents the data source, "V" represents the resource that I am requesting and "C" indicates whether the end-user is shown. But then I got confused.
For example, I'm just trying to create a login screen. I visit a visitor and they will be presented with a traditional login screen. To accomplish this, I've added the following in the RegisterRoutes method in my Global.asax file:
route. MapRoute ("login", "{administrator} / {action}", new {administrator = "account", verb = "login", id = ""}}});
The login process is executed, but this is where I get confused. You see, the login screen is loading for the first time, I just want to show the username / password field. Then on the post, I hope the form is valid and processed. In one attempt to do this, I have made the following method:
Public function logins () {bool is FormValid = ValidateForm (); If (isFormValid) login user (); Other Showers (); See Return (); }
My confusion stays with the login action initially, there is no data but next time, I want to validate the data how can I determine whether the action is a postback or No?
Thank you!
Comments
Post a Comment