Reputation: 811
I followed the tutorial of https://www.youtube.com/watch?v=mU4hV50rkVE&list=PL6n9fhu94yhVkdrusLaQsfERmL_Jh4XmU&index=40
As the video showed, there is an asp-controller attribute in the form tag helper as below:
However, I can't find it in my visual studio:
Although I still type the attribute inside the form tag helper.
After it compiled, the tutorial showed the source-code in the browser:
Meanwhile, there is mine. It is much more different from the tutorial:
I am using the VS 2019 16.2.4 and .net core 2.2. What's wrong with this. How can I solve this? Thank you.
Upvotes: 0
Views: 45
Reputation: 27528
You can add below line in _ViewImports.cshtml
to add TagHelper
support :
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
The purpose of the _ViewImports.cshtml
file is to provide a mechanism to make directives available to pages globally so that you don't have to add them to pages individually.
Upvotes: 2