Kendo ui 无法访问控制器内的模型属性-MVC 5

Kendo ui 无法访问控制器内的模型属性-MVC 5,kendo-ui,asp.net-mvc-5,kendo-editor,Kendo Ui,Asp.net Mvc 5,Kendo Editor,我是MVC的新手。正在尝试实现剑道编辑器功能。我在SQL Server中有一个存储过程,它返回保存的字符串类型的响应。在后端,它与标记一起保存为html内容。我创建了一个具有以下属性的模型。我试图在控制器中使用相同的属性,但不知何故,我无法访问控制器中的属性,不知道为什么。有人能给我指出正确的方向吗?提前谢谢 型号: 公共类LargetextQuestion { [allowtml] 公共字符串响应{get;set;} } 控制器: [HttpGet] 公共行动结果Largetext() {

我是MVC的新手。正在尝试实现剑道编辑器功能。我在SQL Server中有一个存储过程,它返回保存的字符串类型的响应。在后端,它与标记一起保存为html内容。我创建了一个具有以下属性的模型。我试图在控制器中使用相同的属性,但不知何故,我无法访问控制器中的属性,不知道为什么。有人能给我指出正确的方向吗?提前谢谢

型号:

公共类LargetextQuestion
{
[allowtml]
公共字符串响应{get;set;}
}
控制器:

[HttpGet]
公共行动结果Largetext()
{
HsipLargetextQuestionViewModel vm=新的HsipLargetextQuestionViewModel();
var result=hsiplargetextquestionrepository.GetLargeTextdata(cRegion、cStateCode、nFY、reportId、sectionId、subsectionId、displayNumber、questionNumber、questionPartNumber、userId);
vm.Response=结果;
返回视图(vm);
[HttpPost]
公共行动结果Largetext(HsipLargetextQuestionViewModel模型)
{
尝试
{
hsiplargetextquestionrepository.SaveLargetextResponse(cRegion、cStateCode、nFY、reportId、sectionId、subsectionId、displayNumber、questionNumber、questionPartNumber、responseString、userId);
返回内容(“已保存”);
}
捕获(例外e)
{
返回null;
}
}
视图模型:

私有IHsipLargetextQuestionsrepository HsipTargetExtQuestionRepository;
#区域属性
[必需]
[allowtml]
[MaxLength(500,ErrorMessage=“您必须输入少于500个字符。”)]
公共字符串响应{get;set;}
公共十进制问题编号{get;set;}
#端区
公共HsipLargetextQuestionViewModel()
{ }
公共HsipLargetextQuestionViewModel(IHSIPlarGetExtQuestionsRepo)
{
this.hsiplargetextquestionrepository=repo;
}
当我保存记录时,记录不会被保存并更新到数据库中。有人能告诉我正确的方向吗

谢谢,,
Hari

您是否有任何特定错误?这完全取决于GetLargeTextdata方法返回的内容。它是否返回强类型Resultl?我正在修改我的原始帖子。现在问题不同了,我无法返回视图。它抛出了与路由相关的错误。您是否有意不使用Razor视图引擎?右键单击
在控制器中查看
,然后
转到查看
,看看它会带你去哪里。谢谢!!Steve解决了这个问题。我修复了查看部件的布线,完成了。