I have one form in a page in the main area. Views/Home. Code and I want that you see the screenshot.
VS make a color for this form. And it is working with controller
<form asp-action="LoadImg" asp-controller="Account" method="post" enctype="multipart/form-data">
<input type="file" name="ImgPost" /><br>
<input type="submit" value="Загрузить" />
Next, I want to make the same but in Areas/Admin/Views/Home/Private
and I see next
First of all, I want to know why the color in VS is different? And why when I click submit it isn't going to my controller in Areas/Admin/Controllers/Home/Load - action
as usual, I use in areas Razor and its working. It is example of the same page in areas @using (Html.BeginForm("PostSave", "Home", FormMethod.Post))
<form asp-action="Load" asp-controller="Home" method="post" enctype="multipart/form-data">
Thanks
It sounds like VS intellisense isn't loading your tag helpers for your MVC area. You can register the tag helpers explicitly in your view by adding the following line at the top:
using @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
Alternatively add a _ViewImports.cshtml
containing this line to your area, or copy the one from your main ~/Views
folder.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.