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
Post a Comment