I want to set one value in server side session in client side and need to access that session in web service, so i tried below
In client side :
//Set the server side session like below
var vr_="demo.png";
'<%Session["path"] = "' + vr_ + '"; %>';
//In alert,checked the server side session value like below
alert('<%=Session["path"] %>');
the value getting in alert is fine and i called the web service but when try to access the session in web service i am getting the following as session value
' + vr_ + ' not the original value "demo.png"
Please find the source code below,
In Javascript :
var vr_="G:\\13-06-15-demo\\app1\\uploads\\demo.png"
In Jquery ajax request, i called the webservice like below
$.ajax({
url: "../webservice/email.asmx/senmail",
data: "{'tomail': '" + tomail + "','subject': '" + subject + "','message': '" + message + "','attachment': '" + vr_+ "'}",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
In web service, the method is like below
public bool senmail(string toMailId, string subject, string message,string attachment)
{