I read that one cannot use ASP.NET MVC with Server Control which have ViewState including TextBox ?
http://forums.asp.net/t/1216834.aspx
Server controls that do not require
ViewState to fully function will work
in MVC, but anything that requires
PostBack to work properly will not.So bindable, read-only controls like
the Repeater will work, but input
controls like the DropDownList and
TextBox will not.
What should I use then if I cannot even use TextBox ?
ASP.NET and ASP.NET MVC both use a backend coding convention to render HTML markup. In ASP.NET the convention is to use Control classes, and in ASP.NET MVC the convention is to use
HtmlHelperextension methods.The TextBox ASP.NET Control with the following ASP.NET markup
renders the following HTML markup
To get the same result with an
HtmlHelperextension method in an MVC View, the convention is to use theTextBox()extension method. For example,In either ASP.NET or ASP.NET MVC, html markup can be written inline. So, simply writing
is valid for either ASP.NET WebForms or ASP.NET MVC.