我在做什么?
我正在尝试在一个视图中使用两个模态。
有什么问题?
运行时出现这个错误:
An unhandled exception occurred while processing the request.
InvalidOperationException: The model item passed into the ViewDataDictionary is of type 'ProgramaEstagio.Models.Person', but this ViewDataDictionary instance requires a model item of type 'ProgramaEstagio.Models.RegisterViewModel'.
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary.EnsureCompatible(object value)
Run Code Online (Sandbox Code Playgroud)
“PersonController.cs”的一部分:
An unhandled exception occurred while processing the request.
InvalidOperationException: The model item passed into the ViewDataDictionary is of type 'ProgramaEstagio.Models.Person', but this ViewDataDictionary instance requires a model item of type 'ProgramaEstagio.Models.RegisterViewModel'.
Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary.EnsureCompatible(object value)
Run Code Online (Sandbox Code Playgroud)
注册ViewModel.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks; …Run Code Online (Sandbox Code Playgroud)