I have the following @Ajax.ActionLink code:
@Ajax.ActionLink("Assign Ownership",
"AssignOwnership",
new
{
techLogCode = Model.TechLog.Code,
salesRepId = "",
},
new AjaxOptions
{
HttpMethod = "POST",
Confirm = "Are you sure you want to take ownership?",
OnSuccess = "reloadWindow",
OnFailure = "displayAjaxError"
})
I have a dropdown list with an id of owner and I want to use the selected value as the salesRepId. How do I get that value in my @Ajax call?
This is the jQuery I think will work.
$("#owner option:selected").val()
Put your action link on a div and use jQuery to modify a link for your ajax on client side.