Sachin Kainth
Sachin Kainth

Reputation: 46740

Submitting a form in a partial

in my _Layout.cshtml file I have

@Html.Partial("_SearchPartial")

In this partial file I have

@using (Html.BeginForm())
{
    @Html.TextBox("Search")
    <input type="submit" value="Search" />
}                      

Question is, how do I make this form post to a particular action method in a particular controller?

Thanks,

Sachin

Upvotes: 0

Views: 74

Answers (1)

Alex
Alex

Reputation: 35409

@using (Html.BeginForm("ActionName", "ControllerName", FormMethod.Post)) {

http://msdn.microsoft.com/en-us/library/dd460344.aspx

Upvotes: 2

Related Questions