Brierneirricy
New Member
How can i post data to server via Jquery Ajax?JQuery\[code\]function postNewBaseLine() { var id = "300"; $.ajax({ type: "POST", url: "ManagerBaseKit.aspx/SetNewBaseVersion", contentType: "application/json; charset=utf-8", dataType: "json", data: id, success: function(data) { alert('success!'); } });}\[/code\]cs\[code\][WebMethod]public static void SetNewBaseVersion(string version){ // I want it here!}\[/code\]I am using script manager\[code\]<asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" EnablePartialRendering="true" runat="server" />\[/code\]EDIT:after changing to \[code\]data: { 'version': id },\[/code\]I am gettingPOST _http://localhost:49852/ManagerBaseKit.aspx/SetNewBaseVersion 500 (Internal Server Error)