开发者

Saving new records in MVC

开发者 https://www.devze.com 2023-03-31 03:31 出处:网络
Since I didn\'t get any replies in my previous question I will try to ask a more general one. I have a table and class like that:

Since I didn't get any replies in my previous question I will try to ask a more general one.

I have a table and class like that:

PK TeamID int;
FK CountryID int;
   Name string
   ......

In my Create View I have textboxes for the Team table properties and a dropdown list of countries which is populated with values from another DB table.

The开发者_StackOverflow problem I am having is that I can't save new records because ModelState.IsValid always fails. Could someone help me with writing the POST Create method? I am using MVC 2. Thanks in advance.


Sounds like the validation in your view is failing for some reason. Have you checked for any javascript errors when you press submit? Firefox with firebug addon is handy for troubleshooting such things.

0

精彩评论

暂无评论...
验证码 换一张
取 消