How do I get the value of a Session Variable set in JavaScript in a WebMethod
JavaScript:
var img = new Image();
img.src = obj.imageData;
'<%Session["ImgSrc1"] = "' + img.src+'"; %>';
var canvas = document.getElementById("cnv");
var imgX = canvas.toDataURL("image/png");
<%Session["ImgSrc2"] = "'+ imgX +'";%> ;
WebMethod:
string sImage1 = HttpContext.Current.Session["ImgSrc1"].ToString(); // values[10];
string sImage2 = HttpContext.Current.Session["ImgSrc2"].ToString(); // values[10];
sImage1 returns '+ img.src+'
sImage2 returns '+ imgX +'