To go with your example of using a textbox.
Html.TextBoxFor(m=>m.Username) creates the stub of
<input type="text" name="Username" id="Username" />
In order to manipulate this input in MVC 3 (which is pretty much html attributes) is by adding attributes into the applicable parameters
So This
<input type="text" name="Username" id="Username" class="textbox" />
In MVC becomes
@Html.TextBoxFor(m=>m.Username, new { @class = "textbox" });
So for a drop down that looks like the following HTML
<select name="States" id="States" class="dropdown">
<option>FL</option>
<option>NC</option>
</select>
Becomes this in MVC
SelectListItem[] listStates = new[] {
new SelectListItem() { Text = "FL"},
new SelectListItem() { Text = "NC"}
};
@Html.DropDownListFor(m => m.States, listStates, new { @class = "dropdown" })
To specify something to be selected by default all you would have to do is
SelectListItem[] listStates = new[] {
new SelectListItem() { Text = "FL"},
new SelectListItem() { Text = "NC", Selected = true}
};
Set Selected to true and that drop down option would become the selected value.
So you see, its not that MVC doesnt give you full control over the html, its that MVC creates a way to think of the html as objects and what not.
Some links that will help build/clarify on what i've briefly explained.
Practical ASP.NET MVC (3) tips[
^]
ASP.NET MVC3 Razor With jQuery For Beginners[
^]
http://www.asp.net/mvc/mvc3[
^]
Specifics on html helpers
http://stephenwalther.com/archive/2009/03/03/chapter-6-understanding-html-helpers.aspx[
^]
http://weblogs.asp.net/scottgu/archive/2010/01/10/asp-net-mvc-2-strongly-typed-html-helpers.aspx[
^]