Do You know of a way to add focus to an input element on a razor view for Asp.Net Core. I know this can be done via javascript, but is there a tag for that as well? Either on the input element or the containing form element.
Thanks in advance
Søren Rokkedal
You can do this:
<input type="text" name="name" autofocus>
Or
@Html.TextBox("name", null, new { autofocus = "autofocus" })
Or
<input asp-for="name" autofocus/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With