I have the scenario where i will be adding two attribute.
One is dynamic i.e readonly based on user role & another is static i.e id
I tried this below but it is not working for me.
The attribute rendered in HTML for below is
readonlystr = , id = 'emp-name'
var readonlystr = (Model.Role.EmpEdit) ? "" : "readonly=readonly";
@Html.TextBoxFor(m => m.Name, new { readonlystr, @id = "emp-name" })
@Html.TextBoxFor(m => m.Age, new { readonlystr, @id = "emp-age" })
@Html.TextBoxFor(m => m.City, new { readonlystr, @id = "emp-city" })
Any suggestion to achieve this by combining two attributes and pass it?