好吧,这一定是一些愚蠢的东西,我做错了,但我找不到它.
MVC行动:
[AcceptVerbs(HttpVerbs.Post)] public virtual ActionResult Create(BatchCreateviewmodel createModel) { return RedirectToRoute(MVC.Home.display()); }
BatchCreateviewmodel:
public class BatchCreateviewmodel { bool searchAVM; bool searchBPO; bool searchAppraisal; int transactionAge; string Description; string uploadfile; }
View页面上有一些名为“searchAVM”,“searchBPO”,“searchAppraisal”的控件,(复选框)“transactionAge”(一组带整数值的单选按钮)和“description”(文本框)
当我在“Create”条目处中断时,createModel就在那里,但是具有所有默认值(对于字符串为null,对于布尔值为false,对于int为0).如果我检查Request.Form,值就在那里,但它们只是没有进入模型.
我究竟做错了什么?
(这是在MVC 2,框架4下.)
解决方法
原文地址:https://www.jb51.cc/aspnet/247693.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。