I am trying to disable autocomplete feature in browser and put autocomplete=”off” attribute on Input. I have tried to use code below but it do not put autocomplete=”off” on generated Input html tag. What is the correct way to do this?
@Html.EditorFor(model => model.ConfirmPassword, new { autocomplete = "off" })
@Html.EditorFordoesn’t take anobject htmlAttributesas a second argument (or any argument for that matter).Try using
@Html.TextBoxForinstead: