Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Created Issue: The "Model" property will cause model is null [924]

$
0
0
I have Model Class "Project", it has a "Model" property, type is String.
When I create a Action as below:
[HttpPost]
public ActionResult Create(Project model)
{
if (ModelState.IsValid)
{
// save model into database
}
return View(model);
}
Run this action , I found the parameter "model" in Create method is always null, and with exception is "Can't convert String into Project".
Then , I change this property from "Model" to "ModelNumber", everything is OK!

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>