I've been lead to believe, without research, that server controls are forfeited in the MVC model. I am both very curious to know if this is true, and if so, how would one achieve something equivalent to a Repeater control, or any other view whose exact structure depends on the content of the model?
ASP.NET MVC does not support ViewState nor postbacks so all asp.net controls relying on that will not work. The repeater control is one of the few that doesn't need it so it does work though.
The mvc equivalent of control is the HtmlHelper classes which generate html for you. The collection of htmlhelpers is quite large but you will not automatically find equivalents to the regular webforms controls because of the different nature of webforms and asp.net mvc.
MVCContrib is the contrib project for asp.net mvc so you will also find more htmlhelpers there http://www.codeplex.com/MVCContrib
It is also quite easy to roll your own htmlhelper methods
A good starting point for ASP.NET MVC is found here http://www.asp.net/mvc/
I disagree, Yuriy, that controls aren't useful. A set of data-bound MVC controls, easily bound to viewdata, sans obstinate ID rewriting, with no reliance on nasty viewstate or postback gunk and complete control over templating (defaulting to sensible markup), would be an excellent addition to the MVC framework. Controls are a very powerful and useful concept which can significantly increase development time, and shouldn't be discarded solely because they carry some emotional baggage from the ugly old webforms days! :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With