Я хочу передать значение (1) моему контроллеру, как вы видите:
<input id="myButton2" type="button" value="Call Controller Method" onclick="myff('1');" />
Сценарий:
function myff(re) {
$.getJSON('@Url.Action("MyControllerMethod","Reception",new { area ="Admin"})', function (data) {
refid = re;
});
}
Вот мой контроллер
public JsonResult MyControllerMethod(string refid) {
return Json("Controller Method call", JsonRequestBehavior.AllowGet);
}
Но когда я нажал кнопку, действие сработало, но refid
в моем действии равно нулю, почему?