c# - Cant get input parameter to controller, Ajax.ActionLink -
im having problem passing info controller in mvc3
i have view looks this
@ajax.actionlink("mycontroller", "myfunction", new {id =item.data}, new ajaxoptions { updatetargetid = "mydiv", insertionmode = insertionmode.replace, }) <div id="mydiv"> </div>
and controller looks this
public actionresult myfunction(string data) { //some code homecoming partialview(chart); }
it kinda works info dont controller (its null when set breakpoint), when hover on link see info in adressfield. have create adjustment in routingtable?
any input appreciated.
it kinda works info dont controller (its null when set breakpoint)
change line:
@ajax.actionlink("mycontroller", "myfunction", new {id=item.data},
to be:
@ajax.actionlink("mycontroller", "myfunction", new {data =item.data},
the variable names declared in post need match captured server, in other words controller action method
expecting parameter data
, getting passed id
c# asp.net-mvc asp.net-ajax
No comments:
Post a Comment