views:

167

answers:

2

What are your opinions on using web controls in an MVC context?

I came across a good discussion here http://odetocode.com/Blogs/scott/archive/2009/04/09/asp-net-mvc-controls-and-good-versus-evil.aspx but would like to know what the community thinks.

+3  A: 

Personally I would never use them in an MVC project but wouldn't mind seeing them in code as long as they don't rely on ViewState, don't rely on some postback event (such as Control_State_Changed_I_Dont_Know_What(object sender, SomeCrypticEventArgs e)) in a view code behind file and generate valid XHTML and I have full control over the generated HTML.

Oh and forgot to mention: they should not mangle my id and name attributes when used in a master page. Example <input name="ctl00$Content$criteria$City" type="text" id="ctl00_Content_criteria_city" class="cssTextBox" />

Darin Dimitrov
A: 

The WebForms view engine is pretty flexible as is so it really doesn't matter whats shipped with MVC. You could use these controls now if you wanted but nobody seems to be doing that.

I think the MVC community voted "no" to controls a long time ago.

jfar
Um, even though the WebFormsViewEngine is named 'Web Forms' it isn't the same engine used by classic ASP.NET. See my answer here: http://stackoverflow.com/questions/2483503/most-mature-asp-net-mvc-blog-engine/2483559#2483559
George Stocker