c# - making text field viewable but not editable -


I am using code so that users can get permission to view usernames because this name is by Active Directory Given as if the file filed with the name was added to look at but the data is not able to edit any idea how I can achieve it.

  @ Html.EditorFor (model => model.UserName)   

I also have two methods Trying to fall, which do not work with the statement @inlolo or along with

  @ Html.EditorFor (model = & gt; Modal user name, new { @disabled = "disabled"}) @ Html.EditorFor (model = & gt; model.UserName, new {@readonly = "readonly"})    

Go to Go Extension, which you can pass the overload:

  @ Html.TextBoxFor (model => Model .UserName, new {@readonly = true})    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -