asp.net mvc - Multiple Parameters with POST and MVC -
OK so I have two elements on this page that are not in the same form. I need that I can post back my controller through the JQuery.Ajax () method. Now I have the problem that when my parameters are posted correctly, they do the same if I set them as wire and they include the parameter name in value:
Public functioning method (string edge 1, string edge 2) {age 1 = 23; Age 2 = 43} I found
public functioning method (string edge 1, string edge 2) {age1 = "Age1 = 23"; Age 2 = "age 2 = 43"} who is upset Is there any way to ensure that the MVC will map the parameters correctly and just guess it? I really want to do this:
Public functioning method (Int32 Age1, Int32 Age2) {age1 = "Age1 = 23"; JQuery Call: $ Ajax {(// Other stuff data: {age1: $ ('.id'). Val (), age 2: $ ('id2'). Val ()};)};
Opps, this was because I was using serial in my actual code! Oh, is that so!
I do not really see anything wrong in what you are doing, provided you actually go There are numbers 23 and 43 $ through AJAX, and "age 1 = 23" and "age 2 = 43" if you were, the int will certainly not work because the structures should not be enclosed in the stars. Could.
It may be worth it to change your Ajax () call, just to see what happens.
Data: {Edge 1: Parasant ( $ ('. Id'). Val ()), age 2: parseint ($ ('. Id2'). Val ())}
Comments
Post a Comment