For some reasons, when I set my TextAreaFor style properties specifically the width property, it is not working, what I mean is the width is not changing, and the Id is not changing as well:
@Html.TextAreaFor(model => model.AdminSetting.Style, new { htmlAttributes = new
{ @class = "form-control", @style = "width: 100%;", @id = "HelloWorld" } })
But if I remove the word htmlAttributes and change it to this then it working fine. I really wonder why:
@Html.TextAreaFor(model => model.AdminSetting.Style,
new { @class = "form-control", @style = "width: 100%;", @id = "HelloWorld" })
Is there reason why my TextAreaFor htmlAttributes not working unless I remove my declaration of htmlAttributes and declare it like this?
new { @class = "form-control", @style = "width: 100%;", @id = "HelloWorld" })
Instead of this?
new { htmlAttributes = new
{ @class = "form-control", @style = "width: 100%;", @id = "HelloWorld" } })
I've check the documentation, and I am sure that I am using the correct overload.