开发者

mvc - Ajax.BeginForm routevalues and javascript

开发者 https://www.devze.com 2023-01-23 15:53 出处:网络
I\'m using Ajax.BeginForm, and I was wondering if there is a way I could specify one of the routevalues using javascript? like

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

精彩评论

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