I have a view in my asp.net mvc4 web app from which user can configure some things related to it. When user click on a button in this view, let's say, configure view, I want to call a jquery function in another view, let's say, main view. This jquery function is in charge of modifying an element in the main view.
In the configure view where button is, I have below code, some input textboxes and the button (this calls to action AddItem in Configure controller):
@using (Html.BeginForm("AddItem", "Configure", FormMethod.Post))
{
@Html.DropDownListFor(m => m.CustomViewModel.SelectedItemId, Model.CustomViewModel.ListItems)
@Html.TextBox(...)
<input id="submitAdd" type="submit" value="@Resource.ButtonTitleAdd" />
}
So how to do call a jquery function in main view from the above code when user clicks on the button on configure view?
Also I need to pass to this jquery function the value select in the dropdown list of configure view. For example, if dropdown list contains:
"something1" "something2" "something3"
I need to pass the value of the item selected in the dropdownlist. For example, if user selects "something1" and its value is 1, 1 should be passed to this jquery function. This dropdown list is populated with a model.