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

Deadly 提交于 2019-12-11 06:07:20

问题


        <%= 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:

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!


回答1:


I have not tried it but this looks like your problem

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



来源:https://stackoverflow.com/questions/2874163/asp-net-mvc-ajax-actionlink-does-not-work-with-parameters

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!