November Happy Hour will be moved to Thursday December 5th.

CSS autofocus on Html.TextBoxFor

Vote:
 

Hello guys,

does anyone of you know how to set the autofocus property on @Html.TextBoxFor ?

Should look something like this

@Html.TextBoxFor(m => m.User, new {@PlaceHolder = "User name", @Autofocus })

But that doesn't work though.

BR
Patrik

#133308
Sep 01, 2015 14:30
Vote:
 
@Html.TextBoxFor(x => x.User, new { placeholder = "Username", autofocus = ""})
#133311
Sep 01, 2015 14:40
Vote:
 
<p>Thanks Dejan, works perfect.</p>
#133316
Sep 01, 2015 15:18
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.