ASP.NET MVC and LIST PAGES

by Woodrowg 8. May 2009 03:56

Hi another quick note! If you are using the ASP.NET MVC function to create list pages DON'T. Ok maybe don't is an over kill but THINK befor you act!. I have just spent about an 3 hours refactoring my list pages as I wanted to hide and show information based on values that were in the parent object. Tried to do a quick hack as i wanted to get the alpha version ready, which was to set a flag inside of the item loop. So that was working ( I thought) untill of course there was no item in the list ( DOH ).

The better solution was to pass the Parent item over as the model of the page and then do the foreach loop on the collection itself. Which means i have full access to all the lovely properties of the parent and can do so sexy UI customization based on it.

 

 

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: , ,

Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Gary, the last of the unbloged is finaly giving up and will try as often as posible to add anything interesting he finds to this site. especially stuff like ASP.net MVC and things to make people smile