Passing Data from Usercontrol to controller
- by nitinkhanna
Hi,
I am new to MVC, and trying something and got stuck somewhere in between.
I have a user control there I have three textbox html type(ID, Lastname, firstname) and a submit buttom.
I set the button like
<input type="button" value="Search"
onclick="location.href='<%= Url.Action("action", "controller") %>'" />
I have called this usercontrol on some view through
<%= Html.Partial("ucName") %>
Now on pressing that button(on user control) I need to pass the data from these textboxes to controller again to some specific action(Http Post action). By using this data I want to do some database interaction and storing the result in a dataset and pass this data set to same view again to show up in some Grid.
I know the first part in conventional Asp.net can be done by raising the event through delegate but don't know how to do that in MVC.