Ajax.NET and large arguments

On issue I never tested was the length of the request. Because browsers do not allow to use long URLs (I don't know the maximum lenght) you could get a script error on the client-side if the arguments send to the server are too long. I have fixed this in version 5.5.12.3 that will be available for download.

Published Thursday, May 12, 2005 12:00 AM by Michael Schwarz

Comments

# re: Ajax.NET and large arguments

Wednesday, May 11, 2005 7:29 PM by Bertrand Le Roy
In ASP.NET 2.0, we never use GET requests with XmlHttp, only POST. That gets rid of the problem.

# re: Ajax.NET and large arguments

Thursday, May 12, 2005 1:11 AM by Michael Schwarz
;) That I have already done for some days, but I forgot to remove the old way with the GET.

# re: Ajax.NET and large arguments

Thursday, May 12, 2005 6:33 PM by Alan W. Cruz
I'm having a go at making my own ajax wrapper inspired on ur implementation. However, in my httphandler I'm unable to access POST data via context.Request.Form, but context.Request.InputStream.Length has the length of the POST data i'm sending. Could you guys help my with this? thnx

# re: Ajax.NET and large arguments

Thursday, May 12, 2005 6:48 PM by Ole
Alan, why are you working on your own library? Why do you not using the Ajax.NET??

# re: Ajax.NET and large arguments

Thursday, May 12, 2005 8:32 PM by Damien McGivern
Alan when you use POST the data is stored in Response.Headers

# re: Ajax.NET and large arguments

Thursday, May 12, 2005 9:00 PM by Damien McGivern
Alan - sorry I was thinking of something else(setRequestHeader) in that last post - you have to read the input stream yourself - you don't use Request.Form

# re: Ajax.NET and large arguments

Friday, May 13, 2005 5:33 AM by ttyp
when i use your demo to test.and i add a simple HttpModule to this project.then an error 'undefined variable DemoMethods' is occured.why?

the HttpModule code is:

added in web.config

<httpModules>
<add name="MyModuler" type="MyModuler.demo, MyModuler" />
</httpModules>


added in Global.asax:

protected void MyModuler_OnMyEvent(Object src, EventArgs e)
{
//Context.Response.Write("Hello from MyModule_OnMyEvent called in Global.asax.<br>");
}


demo.cs

using System;
using System.Web;

namespace MyModuler
{
/// <summary>
/// Class1 的摘要说明。
/// </summary>
public class demo:IHttpModule
{
public demo()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public void Init(HttpApplication app)
{
app.BeginRequest += new EventHandler(OnBeginRequest);
}

public void Dispose(){ }
public delegate void MyEventHandler(Object s, EventArgs e);
private MyEventHandler _eventHandler = null;
public event MyEventHandler MyEvent
{
add { _eventHandler += value; }
remove { _eventHandler -= value; }
}
public void OnBeginRequest(Object s, EventArgs e)
{
HttpApplication app = s as HttpApplication;
app.Context.Response.Write("Hello from OnBeginRequest in custom module.<br>");
if(_eventHandler!=null)
_eventHandler(this, null);
}
}
}


# re: Ajax.NET and large arguments

Friday, May 13, 2005 9:50 AM by Alan W. Cruz
Yup, I had to read the input stream and seperate parameters manually, why is this? I'm making my own library just for fun and of course to learn something new ;). I was very interested in how reflection could expose assembly methods but since the ajax.net wrapper source wasn't available I began my own :) thnx guys.

# re: Ajax.NET and large arguments

Friday, May 13, 2005 2:52 PM by Michael Schwarz
@ttyp: If you write something on each request you will modify my javascript files, also. And if you write "no javascript" code there will be an error on execution time. You have to check if the url is below the "ajax" folder.

# re: Ajax.NET and large arguments

Monday, May 16, 2005 12:22 AM by ttyp
i just write some demo wrods.how can i modify the javascript files you point?
the project is your c# demo.what is the 'ajax' folder?

btw:can you say something about how can you translate server method into client method?