View Full Version : Update large data with Ext.Ajax.Request

3 Aug 2012, 1:56 AM

I want to send a big data to server. I know we can use parameter in Ajax Request. But I think maybe it's not secured and server may deny a long parameter.

Do we have other way to do this?
For example
url: '<%=WwwRoot%>/page.aspx',
method: 'POST',
data: ................... (here is the data sent to server and .... how can we get it on server? C#, ASP.NET)
scope: this,

Thank you

3 Aug 2012, 3:23 AM
Hi hieu79vn,
Instead of using aspx page on the server side, you can use webservice provided by ASP.NET - .asmx page.
I am giving you can example how to send data to the webservice (.asmx page).

js code from where request will be sent -

url: '/webservice/MyService.asmx/AddUser' // AddUser is the webmethod name
// name of the fields will be same as we have arguments in the AddUser() in webservice
, params: {
name: 'xxxx'
, age: 23
, contactNo: 2222222222
, method: 'POST'
, headers: {
'content-type': 'application/json'
, success: function (data) {
// do any task

Now the server side code:

using System.Web;
using System.Web.Security;
using System.Web.Script.Services;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Collections;
using System.Collections.Generic;

public class RiskMgtService : WebService
[ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true, XmlSerializeString = false)]
public string AddUser(string name, string age, string contactNo) // parameter will be same as we are sending the values in params config of Ajax.request
// do anything with data

5 Aug 2012, 11:27 PM
Thank you sword-it I will try it

6 Aug 2012, 9:00 AM
Also make sure to set IIS to receive large amounts of POST data.