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.
精彩评论