Click here to Skip to main content
15,077,641 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created dynamic form using textbox,checkbox,radio button in mvc 4 razor, Now I want to get values after filled form on button click, How can i get values.

This is my cshtml code
@{foreach (var item in Model)
  <input class="form-control " type="@item.ControlName" value="">

I want to recieve my values in controller

public ActionResult ShowForms()

If anyone knows please help me.
Thanks in advance..........!
Updated 20-Feb-15 0:19am

1 solution

Your form needs a submit button and also an action (post) associated to the form itself.
Once you hit the submit button, action method in the corresponding controller will be called and values will be passed to it.

Go through "Implementing Add New Product (Part 2 - First Approach)" here[^].

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900