making text field viewable but not editable

aomokaoy

New Member
I am using the code bellow to allow users to add view the user name as this name is given by the active directory i would like them to see the filed with name added but not able to edit the data any ideas how i would be able to achieve this \[code\]@Html.EditorFor(model => model.UserName)\[/code\]I have also tried the folowwing two methods which do no work both with or with @ anslo with the statment true\[code\]@Html.EditorFor(model => model.UserName, new { @disabled ="disabled"})@Html.EditorFor(model => model.UserName, new { @readonly = "readonly" })\[/code\]
 
Back
Top