JavaScriptSerializer jss = new JavaScriptSerializer();
var seferim = jss.Serialize(sefer);
string asds = seferim.ToString();
asds = HttpUtility.HtmlEncode(asds);
function otobusGetir(id, b, i) {
id = encodeURI(id);
$.ajax({
type: 'POST',
url: 'BiletSatis.aspx/Getir',
contentType: 'application/json;charset=utf-8',
dataType: 'json',
data: '{"id":"' + id + '","Binis":"' + b + '","Inis":"' + i + '"}',
success: function () { },
error: function () { }
})
[WebMethod]
public static string Getir(string id, string Binis, string Inis)
{
string a = id;
string b = HttpUtility.HtmlDecode(id);
return null;
}
The problem is javascript function cannot take parameter(Uncaught SyntaxError: Unexpected token ILLEGAL) which is serialized.How i can totally done tihs job?
The problem is that this is not working while javascript function run it can not take argument,how can totaly don this job
Try like this:
and to call the function:
and the page method: