javascript - Constant in a key value pair -



javascript - Constant in a key value pair -

i doing post action in mvc 5 javascript in order set variable in session:

$.post('@url.action("myaction", "mycontroller"), { key: "mykey", value: returnvalue });

where homecoming value comes service , string "mykey" value in session stored as:

so myaction looks like:

[httppost] public void myaction(string key, string value) { session[key] = value; }

i can't see why have store in variable in first place. should trick.

[httppost] public void myaction(string value) { session["mykey"] = value; }

javascript c# session-variables

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -