MVC5 's pit.

Source: Internet
Author: User

The thing is, today, when we write a function module, the method is created, to the controller, dead or Alive is null.

Never before this situation ah, but the difference is that the code is a multi-layered jump in, is not the page jump too much, remember before the model, then try, changed the method name, the General page is create, but this, considering the possibility and the original repetition, the name of the word again try, Change to CREATESCP, the result is still the same, that is not the reason.

After the degree Niang, found a Bo friend hair, and my same, reference https://www.cnblogs.com/sdfkfkd/p/Mvc_Controller_Parameter_Null.html

The problem here is that I have a property named model in this entity .....???????. 10,000 grass and mud horses are galloping past ........

In fact, I did not study this, the post-commit action corresponding value of the way is corresponding to the name, then the property has a model, and then this is not case-sensitive, then do not know when the model to the corresponding entity or property, So it simply returns NULL.

The solution is:

The first one renames the attribute without any of the model or model;

The second is that the parameter name in this action is not called model, and it is the same as the other non-attribute names.

The third kind, someone said, I haven't tried.

The data passed is in model. ID This JSON structure passed over, interested can try.

MVC5 's pit.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.