I have this method in my Controller that saves the value in a Tempdata, as shown below.
public Boolean SaveSession(string id) {
TempData["CurrentTab"] = id;
return true;
}
Now in my javascript, I want to get the value in that TempData. But when I alerted the value I got this value. "[object HTMLSpanElement]"
@{
if (TempData["CurrentTab"] != null){
@:alert("" + @TempData["CurrentTab"].ToString())
}
}
How can I get the string value of that Tempdata?
Thanks