stuff here

running (15) C# (9) marathon (7) Entity Framework (3) MVC (3) clyde stride (3) clyde walkway (3) Ajax (2) MongoDb (2) SQL Server (2) 404 (1) Exception (1) Garmin (1) Intellipad (1) JQuery (1) MVC MVC3 Ajax RenderAction (1) MVC Validation (1) MVC3 (1) MVC3 Ajax Themes (1) MVC3 MVC (1) Node.js (1) Oslo (1) Task (1) Temp Tables (1) Triathlon (1) TypeScript (1) Umbraco (1) WSE (1) WSE 2010 (1) WSE 2012 (1) Woff (1) cooking (1) crystal reports (1) cycle Clyde tunnel (1) forerunner 305 (1) gps (1) heart rate monitor (1) reporting Services (1)
Showing posts with label MVC MVC3 Ajax RenderAction. Show all posts
Showing posts with label MVC MVC3 Ajax RenderAction. Show all posts

Tuesday, 29 November 2011

JQuery DatePicker Ajax and MVC RenderAction

So how to do you replicate a MVC Html.RenderAction with JQuery datepicker

I have controller which gives me a daily use data based on a data, I've skipped the boring dal logic with "....." and is shown below.















So I want a default Load which  I can use  Html.RenderAction wrapped in a
with and id of DailyUsage.  So this will only show on a page refresh/load.

 @{ Html.RenderAction("DailyUsage", new { date = DateTime.Now});  }



So I need a Ajax script with the date picker which will update the current table with the selected date. The script below does this by using ajax GET for the controller action.  


 $('#DailyUsage').html(result);   replaces the div contents with the results (partial class) of the controller action. 

Full Code is here