0
私はRazorPageから継承してベースページを定義しようとしています。私はページの私の@inheritセクションでTModelの以外のものを渡すと、私は次のエラーを取得する:ASP .Netコア - RazorPageから継承<TModel>問題
ArgumentException: Property 'ViewData' is of type 'Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary`1[[MyProject.Models.IndexViewModel, MyProject, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]', but this method requires a value of type 'Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary`1[[System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]'.
パラメータ名:viewContext
どのように私はのViewDataを上書きすることができますので、私は私のカスタムを渡すことができます次の行で代わりのモデルIndexViewModel:
@inheritsは
をMyProject.Base.BaseViewのおかげ