I've used this info but its not working
How to Create Session Variable in JavaScript MVC3 Razor View engine .cshtml
Any idea?
This is my SetVariable ActionResult:
Public Function SetVariable(key As String, value As String) As ActionResult
Session(key) = value
Return Me.Json(New With { _
Key .success = True _
})
End Function
This is the JS function which calls the previous function
function Comprobacion2(s, e) {
$(function () {
$.post('/Home/SetVariable',
{ key: "cadena", value: "Nueva" }, function (data) {
alert("Exito, cambio realizado " + '@Session("cadena")');
});
});
}