Edit not working
-
Hi, I created a mvc web project with scaffolding that displays well in the Index page. When I edit, I do not want any of the fields in the edit page to edit. Instead, I added a textbox whose value I calculate and save the rest of the fields to the database. I cannot get this to work, as the model in the HttpPost is null. Please help. Thanks
-
Hi, I created a mvc web project with scaffolding that displays well in the Index page. When I edit, I do not want any of the fields in the edit page to edit. Instead, I added a textbox whose value I calculate and save the rest of the fields to the database. I cannot get this to work, as the model in the HttpPost is null. Please help. Thanks
Have you looked into any tutorials about doing CRUD in ASP.NET MVC? You should be able get more references in the web. The idea is to send back the model to your action method if your action requires the model on POST request. I would really recommend you to read the basics on how MVC arch works before jumping into the limbo. Here's an article that may help you understand the basic of ASP.NET MVC: ASP.NET MVC 5: Building Your First Web Application - Part 1[^]
-
Hi, I created a mvc web project with scaffolding that displays well in the Index page. When I edit, I do not want any of the fields in the edit page to edit. Instead, I added a textbox whose value I calculate and save the rest of the fields to the database. I cannot get this to work, as the model in the HttpPost is null. Please help. Thanks
There's a problem somewhere in your secret code. You should fix that. If you want someone else to help you fix it, then you'll need to share the relevant parts of your code.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Hi, I created a mvc web project with scaffolding that displays well in the Index page. When I edit, I do not want any of the fields in the edit page to edit. Instead, I added a textbox whose value I calculate and save the rest of the fields to the database. I cannot get this to work, as the model in the HttpPost is null. Please help. Thanks
Did you wrap the textboxes and submit button in a form tag or element?, so the input elements post back to the controller.
21st Century Globalism has become Socialism on a planetary scale, in which the unequal treaties of the past have come back into play.