Created
          June 22, 2011 19:00 
        
      - 
      
 - 
        
Save jasondentler/1040832 to your computer and use it in GitHub Desktop.  
    The Pieces
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <html> | |
| <head> | |
| <title>@ViewBag.Title</title> | |
| <!-- various css and javascript includes go here --> | |
| @if (Model != null) | |
| { | |
| <script type="text/javascript"> | |
| model = @Model.ToJson(); | |
| </script> | |
| } | |
| </head> | |
| <body> | |
| <!-- Static HTML page header stuff goes here --> | |
| @RenderBody() | |
| <!-- Static HTML footer stuff goes here --> | |
| </body> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <script type="text/javascript"> | |
| model = @Model.ToJson(); | |
| </script> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <script type="text/javascript"> | |
| model = {"Id": "4", "FirstName": "John", "LastName": "Smith"}; | |
| </script> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | [HttpGet, ImportModelState] | |
| public ActionResult Details(Guid Id) | |
| { | |
| return Request.IsAjaxRequest() | |
| ? (ActionResult) Json(GetDetailsModel(Id), JsonRequestBehavior.AllowGet) | |
| : View(GetDetailsModel(Id)); | |
| } | |
| [HttpPost, ExportModelState] | |
| public RedirectToActionResult AddItem(AddItem model) | |
| { | |
| ExecuteCommand(model) | |
| return this.RedirectToAction(c => c.Details(model.Id)); | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | @model Index | |
| @{ | |
| ViewBag.Title = "Instructors"; | |
| Html.RegisterTemplate("instructorListTemplate", "Templates/instructorList.tmpl.html"); | |
| } | |
| <script id="template" type="text/html"> | |
| {{tmpl "#instructorListTemplate"}} | |
| <h2 class="hint">Choose an instructor from the left</h2> | |
| </script> | |
| <div data-bind='template: "template"' /> | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment