Results 1 to 15 of 15

Thread: MVC 4 using Stored Procedure to display view

Threaded View

  1. #7
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Re: MVC 4 using Stored Procedure to display view

    The code you have should work. All you have to do is "return View(empList )"; at the end of your ActionResult. Just make sure you define your model (in the view) as List<EmployeeInfo>.

    In your view you will just loop through your List of items and display them.

    On a personal note, I love MVC, I've used webforms for years but ever since MVC came out, I switched and never looked back. Webforms is bloated, heavy and non-optimized framework. MS basically wanted to convert VB developers to the web when they introduced WebForms, trying to mimic classic VB events (Button click etc) adding a bloat of ViewState. With MVC you control your output, it's slimmer and your pages load a lot faster. Plus you get a de-coupling of data and presentation layer (WebForms are file based, usually having a code-behind cs or vb file for each page file). With MVC you decide what view to render (no more if something.....Response.Redirect() and most of all you get Test Driven Development (TDD) environment. You can test your code, you can fine tune it before launching your application. I can go on and on but it's been already off-topic
    Last edited by Serge; Apr 12th, 2013 at 12:43 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width