I am trying to pass an object defined to any page method. I'm trying to pass data to collect it from three text boxes. [System.Web.Services.WebMethod] Public Fixed String saveDataToServer (Object CSobage) {// Function Body} {/ P>
Page Method / Code> JavaScript / jQuery PostDataToServer is now reaching the call web method. no problem. I am getting an object too. But how do I process the object? As you can see, The same is what I am getting, I also tried to declare a class and pass it as a parameter .. but all its assets are empty. If you see that the data is visible as a key, then the value pair. I can convert it to a dictionary, but I believe it is a complex solution. A simple solution was welcomed Will go! Please find the appropriate way to do this, you too can do it.
$ ("# osmSendMsg"). Click (function () {debugger; var cntDetails ({# CntName: $ ("# osmContactName", "wait", "/ ContactUs.aspx / saveDataToServer", "csObj");});
// Post data to server (AJAX call). Function PostDataSource (DataTaused, Stormat Gateto Show, StormTyocol, JasonObjectName) { Debugger; / * Includes JSON object in datacentend SubmitType 1 == Submit normal; 2 == Submit and print Strmessageto Show the text that you please wait In the window. * / Var tempurl = strMethodToCall; var tempdata; $ .ajax ({url: tempurl, type: "post", async: false, data type: "jason", data: "{" + json object name +: "+ JSON.stringify (dataToSend) +"} ", // Timeout: 30000, Content Type:" Application / Jason; Charset = UTF-8 ", Success: Function (Data) {tempdata = data;}, Error: Task (result) {tempdata = null;}}; // Ajax call return end of tempdata;} // closing of post data
No comments:
Post a Comment