Put @ in front of the style and in bulk, for example, even put htmlAttributes: in front of it.
@Html.TextArea("txtComments", htmlAttributes: new { @style = "width: 450px;", @placeholder = "Enter Comments here" })
And this is the exact result that I get:
<textarea cols="20" id="txtComments" name="txtComments" placeholder="Enter Comments here" rows="2" style="width: 450px;"></textarea>
If this shows the placeholder, but it still does not appear, make sure you are using a modern web browser, you can find a list of supported browsers here: http://caniuse.com/input-placeholder
< IE10 does not support it.
If you need support in these browsers, perhaps this solution will help you: http://webdesignerwall.com/tutorials/cross-browser-html5-placeholder-text
source share