<p>I am using the Html.TextBox helper to create textboxes.  I want to set attributes on the textbox, which I understand is done using the following overload: </p>

<p><code>Html.TextBox (string name, object value, object htmlAttributes)</code></p>

<p>However, I want to maintain the functionality where the HTML helper automatically uses the value from either ViewData or ViewData.Model and I do not see a way to just specify the name and the htmlAttributes.  Is this possible?</p>

[EDIT]  After looking at the
source code
, it appears that all you need to do is specify the value as null in the signature that takes a name, value, and htmlAttributes.  If the value is null, it will attempt to use the value from the ViewData.
```
```
Html.TextBox( "name", null, new { @class = "css-class" } );
```
```