@model Model.OAuthModel @{ ViewData["Title"] = "OauthEdit"; Layout = "~/Areas/manager/Views/Shared/_Layout.cshtml"; } <h2>OauthEdit</h2> <h4>OAuthModel</h4> <hr /> <div class="row"> <div class="col-md-4"> <form asp-action="OauthEdit"> <div asp-validation-summary="ModelOnly" class="text-danger"></div> <div class="form-group"> <label asp-for="id" class="control-label"></label> <input asp-for="id" class="form-control" /> <span asp-validation-for="id" class="text-danger"></span> </div> <div class="form-group"> <label asp-for="title" class="control-label"></label> <input asp-for="title" class="form-control" /> <span asp-validation-for="title" class="text-danger"></span> </div> <div class="form-group"> <label asp-for="oauth_name" class="control-label"></label> <input asp-for="oauth_name" class="form-control" /> <span asp-validation-for="oauth_name" class="text-danger"></span> </div> <div class="form-group"> <label asp-for="oauth_imgurl" class="control-label"></label> <input asp-for="oauth_imgurl" class="form-control" /> <span asp-validation-for="oauth_imgurl" class="text-danger"></span> </div> <div class="form-group"> <label asp-for="oauth_id" class="control-label"></label> <input asp-for="oauth_id" class="form-control" /> <span asp-validation-for="oauth_id" class="text-danger"></span> </div> <div class="form-group"> <label asp-for="oauth_key" class="control-label"></label> <input asp-for="oauth_key" class="form-control" /> <span asp-validation-for="oauth_key" class="text-danger"></span> </div> <div class="form-group"> <label asp-for="remark" class="control-label"></label> <input asp-for="remark" class="form-control" /> <span asp-validation-for="remark" class="text-danger"></span> </div> <div class="form-group"> <input type="submit" value="Save" class="btn btn-default" /> </div> </form> </div> </div> <div> <a asp-action="Index">Back to List</a> </div>
Create和Edit是这种语法,而List和Details是传统mvc中的语法。
_ViewImports.cshtml
中有没有@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
?
根据您的提示,原来是area中没有_ViewImports.cshtml,加上就可以了。