Why oh why doesn't this code do Anything?! What is wrong with my ajax? My ajax:
$.ajax({
type: "POST",
url: "/index.aspx/Uppdatera",
data: "{ Id:"+ JSON.stringify($item.Id) +" }",
error:
alert("error")
});
My C#:
[WebMethod(EnableSession = true)]
public static void Uppdatera(object id)
{
id.ToString();
using (StreamWriter s = new StreamWriter("C:/Users/robert/Documents/visual studio 2013/Projects/GolvProjektet/GolvProjektet/hej.txt"))
{
s.Write("hej" + id);
}
}