Skip to main content

Posts

Showing posts from June, 2011

Jquery form plugin with asp.net mvc flavour

I am a great fan of jquery form plugin which is one of my favorites. It's really simple to integrate Ajax in your web pages with jquery form with very thorough documentation found at the site. Basically it really speed up the things. I had extended some of the examples found in the documentation and had created a small implementation of login in Asp.net mvc. So here how it goes. Model: public class User { public string UserName { get; set; } public string Password { get; set; } } Controller: public ActionResult JqueryFormDemo() { return View(); } public string Login(User User) { if(User.UserName=="mazhar" && User.Password=="mazhar") return "You are successfully login" ; else return "Login Failed"; } View: @model MvcApplication5.Models.User <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive....