Friday, May 25, 2012

Load partial page in jquery and ASP.Net MVC

http://miroprocessordev.blogspot.ca/2012/05/load-partial-page-in-jquery-and-aspnet.html


$('#usersdiv').load('/home?name=' + $(this).val() + ' #usersdiv');


public class HomeController
{
   public ActionResult Index(String name = "")
   {
      List<user> users = GetUsers()
                           .Where(u => u.Name.ToLower().StartWith(name.ToLower()) 
                                    || String.IsNullOrEmpty(search)).ToList();
      return view(users);
   }
}