[jQuery] Re: $ajax() question

2009-09-02 Thread Dave Ward
It may be too late, but I would recommend avoiding a call to an ASPX page like that. Even though you're not using it, the entire ASP.NET WebForms Page class is instantiated for any call to an ASPX page, which has significant overhead. An ASMX web service or ASHX handler would be much better choi

[jQuery] Re: $ajax() question

2009-08-12 Thread Stephan Beal
On Aug 12, 12:03 am, yi wrote: > OK I will try "object of key/value pairs". > You mean i should use "data:{Arg:args2} ". is it right? Right :)

[jQuery] Re: $ajax() question

2009-08-11 Thread yi
OK I will try "object of key/value pairs". You mean i should use "data:{Arg:args2} ". is it right? On Aug 12, 4:05 am, Stephan Beal wrote: > On Aug 11, 11:53 am, Jules wrote: > > > After re-reading the original post, it seems json is not required > > > just use > > data:"Args="+args2 > > Don't

[jQuery] Re: $ajax() question

2009-08-11 Thread yi
Thanks Jules that is really helpful. thank you so much!!! I konw what i am going to do now!!! On Aug 11, 9:53 pm, Jules wrote: > After re-reading the original post, it seems json is not required > > just use > data:"Args="+args2 > > on the server side > > StreamReader reader = new StreamReader(R

[jQuery] Re: $ajax() question

2009-08-11 Thread Stephan Beal
On Aug 11, 11:53 am, Jules wrote: > After re-reading the original post, it seems json is not required > > just use > data:"Args="+args2 Don't do that. If args2 contains any invalid characters (i.e. a space) then this will fail, possibly in mysterious ways. Always send the data as an object of ke

[jQuery] Re: $ajax() question

2009-08-11 Thread Jules
After re-reading the original post, it seems json is not required just use data:"Args="+args2 on the server side StreamReader reader = new StreamReader(Request.InputStream); string param = reader.ReadToEnd(); param = "Args=abc" assuming args2="abc" Just use split() to get the value. On Aug

[jQuery] Re: $ajax() question

2009-08-10 Thread Jules
JavaScriptSerializer is included in AJAX 1.0. It is compatible with .NET 2.0. http://www.asp.net/ajax/downloads/archive/ You don't have to use the ajax component on your client to use it. On Aug 11, 1:18 pm, yi wrote: > Hi Jules: > If i use old version of ASP.net, Can i Deserialize Json data?

[jQuery] Re: $ajax() question

2009-08-10 Thread yi
Hi Jules: If i use old version of ASP.net, Can i Deserialize Json data? thanks Jules!!! On Aug 11, 3:01 pm, Jules wrote: > Opps, > You are right, change the contentType to > > contentType: "application/json; charset=utf-8" > > here is a snippet to handle generic json in C# .NET 3.5 > > JavaScri

[jQuery] Re: $ajax() question

2009-08-10 Thread Jules
Opps, You are right, change the contentType to contentType: "application/json; charset=utf-8" here is a snippet to handle generic json in C# .NET 3.5 JavaScriptSerializer ser = new JavaScriptSerializer(); StreamReader reader = new StreamReader(Request.InputStream); object input = ser.Deserializ

[jQuery] Re: $ajax() question

2009-08-10 Thread yi
hi Jules: I use Request("Arg") , but it doesn't work. it always give me empty string contentType: "text" is it right? do i need make it contentType: "Json", ? If i need use JSON, do you know how to read json data at sever side in asp.net? thanks so much!!! On Aug 11, 12:50 pm, Jules wrote:

[jQuery] Re: $ajax() question

2009-08-10 Thread Jules
Use Request("Arg") instead, this syntax gets the Arg from data post or querystring. Do not enclose args2, the server will get "args2" instead of the value of args2. data:{Arg:args2} On Aug 11, 10:12 am, yi wrote: > Hi Jules: > thank you for your help!! > if I use this: > > type: "POST", > url:

[jQuery] Re: $ajax() question

2009-08-10 Thread yi
Hi Jules: thank you for your help!! if I use this: type: "POST", url: "mywebpage.aspx, data:{Arg:"args2"} Do you know how can i get value of arg from sever side(code behind)? I use asp.net, but i dont know how to fatch data when data put inside {}, " data:{Arg:"args2"} " Can i still use "Request

[jQuery] Re: $ajax() question

2009-08-10 Thread Jules
There is a limit on url length depending on the browser. http://classicasp.aspfaq.com/forms/what-is-the-limit-on-querystring/get/url-parameters.html use type:"POST" and data: instead and do not enclose the object declaration data:{Arg:args2} instead of data:"{Arg:args2}" On Aug 11, 8:41 am, y

[jQuery] Re: ajax question

2009-02-20 Thread MorningZ
var MyData = {}; MyData[$a] = x; data: MyData And just to note, common practice shown in the jQuery library and plugins is that variables starting with "$" are ones that are jQuery objects. not that you *have* to do it, but it would make sense to follow what others are doing On Feb 20, 9

[jQuery] Re: $.ajax question

2007-08-12 Thread Eridius
Another question about the data that is passed to $.ajax, is there a limit on the string length that can be passed for the data? Ganeshji Marwaha wrote: > > As far as i know, you wont be able to pass a form id to $.ajax method. > Unless you want to pass it through one of the available paramete

[jQuery] Re: $.ajax question

2007-08-12 Thread Ganeshji Marwaha
As far as i know, you wont be able to pass a form id to $.ajax method. Unless you want to pass it through one of the available parameters. -GTG On 8/12/07, Eridius <[EMAIL PROTECTED]> wrote: > > > > The reason for the question is that i am create a $.ajax_request class to > provide additional fu

[jQuery] Re: $.ajax question

2007-08-12 Thread Eridius
The reason for the question is that i am create a $.ajax_request class to provide additional functionality to the current ajax request. Ganeshji Marwaha wrote: > > If you are looking to submit a form using ajax, the you should take a look > at the form plugin. http://www.malsup.com/jquery/form

[jQuery] Re: $.ajax question

2007-08-12 Thread Ganeshji Marwaha
If you are looking to submit a form using ajax, the you should take a look at the form plugin. http://www.malsup.com/jquery/form/ This plugin offers 2 methods( among others) to submit a form using ajax. They are ajaxSubmit() and ajaxForm(). More info can be obtained from the documentation. -GTG