开发者

mvc - Ajax.BeginForm routevalues and javascript

I'm using Ajax.BeginForm, and I was wondering if there is a way I could specify one of the routevalues using javascript? like

Ajax.BeginForm("CastVote", "Vote", new {VotingType = "javascriptfunctiongoeshere", add = 1开发者_Python百科})


Html helpers execute at the server side and cannot use variables from javascript. You might need to modify the action attribute of the generated form: give it an id and then subscribe for the onsubmit event and change the values.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜