Passing Data from Usercontrol to controller

Posted by nitinkhanna on Stack Overflow See other posts from Stack Overflow or by nitinkhanna
Published on 2010-06-01T04:41:23Z Indexed on 2010/06/01 4:43 UTC
Read the original article Hit count: 241

Filed under:
|
|
|

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.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-mvc