开发者

ASP.NET MVC: Ajax.Actionlink Does not work with parameters

开发者 https://www.devze.com 2022-12-31 23:12 出处:网络
<%= Ajax.ActionLink(\"DrillDown\", \"EventOverzichtAjax\", new { GroepID = Model.GroepID.ToString(),
        <%= Ajax.ActionLink("DrillDown", "EventOverzichtAjax", new { GroepID = Model.GroepID.ToString(), 
                                                                    groepType = Model.GroepType.ToString(), 
                                                                    manager = Model.isManager }, 
                                                            new AjaxOptions { UpdateTargetId = Model.GroepID.ToString(),
                                                                              OnBegin = string.Format("beginOverzichtFetch('{0}')", Model.GroepID),
                                                                              OnComplete = string.Format("completeOverzichtFetch('{0}')", Model.GroepID)}) %>

I'm having some issues 开发者_运维技巧with the onBegin and onComplate properties. They work perfectly as i want. But they do not when i'm trying to pass a parameter with the function.

For example:

   OnBegin = "beginOverzichtFetch"

Works perfectly. But

  OnBegin = "beginOverzichtFetch(1)"

Does not work at all. When i use chrome inspector to see where the fault occurs:

ASP.NET MVC: Ajax.Actionlink Does not work with parameters

What happens when my link: Nothing gets updated but i get redirect to the partial view.

Anyone knows how to pass parameters to functions in the onBegin property?

Help would be appreciated! Thanks!


I have not tried it but this looks like your problem

http://forums.asp.net/t/1414473.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消