开发者

Update DB MVC 3 using RadioButton values

In my MVC 3 project, I am looking to select a row in a table displaying values from a database, choose a radio button representing a value and press "Confirm". I then want a row to be added to a ClientPayments table with the payment amount as the radio button value (and the other values in the other columns of ClientPayments). I also want the status in an Invoices table to change to "Confirmed".

Here's a link to a screenshot to illustrate what I want to do.

I have all the models and the views created, but I am not sure how to select the row and use the radio buttons to update the DB.

This is one of the radio buttons I have coded:

Private Lesson (1 Hour) @Ht开发者_运维技巧ml.RadioButton("InvoiceAmount", "640", true)

Any assistance would be greatly appreciated.


If you have something like @Html.RadioButton("InvoiceAmount", LineId, true) (where LineId is the key value from model) then you will get the selected row in your Post action. From there you can either add it to your client payment object, and do whatever else you need to do!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜