If you've enabled the "unobtrusive AJAX" option, something like this should work:
@Ajax.ActionLink("Make month salary", "createsalary", new { @name = wanna put value here }, new AjaxOptions()
{
UpdateTargetId = "Sal",
HttpMethod = "Get",
InsertionMode = InsertionMode.InsertAfter,
OnBegin = "onCreateSalaryBegin"
});
...
<script>
function onCreateSalaryBegin(xhr, settings) {
var empName = $("#drop").val();
settings.data = $.extend(settings.data, { EmpName: empName });
}
</script>
To enable unobtrustive AJAX, you'll need an
appSetting
in your
web.config
file:
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
You'll also need to include the
jquery.unobtrusive-ajax.min.js
script in your view.