New version of AJAX Wrapper for .NET

A new version of the AJAX Wrapper DLL is available online for free at http://ajax.schwarz-interactive.de/download/ajax.zip. For demonstration I have added a new sample (including source code of sample project) that will show how to use the AJAX Wrapper DLL in you projects:

http://ajax.schwarz-interactive.de/csharpsample/default.aspx
http://ajax.schwarz-interactive.de/vbnetsample/default.aspx

Now, the AJAX Wrapper DLL is working with VB.NET, C# and any other .NET language. Firefox, Mozilla and Internet Explorer are supporting XmlHttp request, and there is no need to adapt Javascript code.

You can now use bool, int, string, xml and your own classes as return value. If you return your own class you will be able to use it directly as a real object. In the sample take a look at the AuthenticationInfo class.

function authenticate()
{
  Authenticate(user, pwd, authenticate_callback, authenticate_error);
}

function authenticate_callback(res)
{
  alert("Hello " + res.Username);
}
    
function authenticate_error(xmlhttp)
{
  alert("HTTP Status: " + xmlhttp.status);
}

On the client side you can use callbacks to allow asynchron calls to the webserver. A second callback will be called if an error occured.

For more details on AJAX: http://adaptivepath.com/publications/essays/archives/000385.php

Published Thursday, April 7, 2005 10:42 AM by Michael Schwarz

Comments

# re: New version of AJAX Wrapper for .NET

Thursday, April 7, 2005 3:47 PM by Julien
Great software, Michael!! Is the wrapper working with all .NET languages?

# re: New version of AJAX Wrapper for .NET

Thursday, April 7, 2005 7:02 PM by Ulli Devuru
Super, genau das, wonach ich schon lange suche!! PRIMA!!!!!

# re: New version of AJAX Wrapper for .NET

Friday, April 8, 2005 2:47 AM by ttyp
why don't you share your code?

# re: New version of AJAX Wrapper for .NET

Friday, April 8, 2005 3:14 AM by sean
any chance to support array of object?

# re: New version of AJAX Wrapper for .NET

Friday, April 8, 2005 4:19 AM by Michael Schwarz
Why don't share code? At the moment I use this Ajax Wrapper in several projects that are running live. The Ajax DLL will be free for download. I will think about to share code with some partners, please contact me, send my some details about your company,...

The second question was "any chance to support array of object"? YES, I will write here on the blog the next days when finished work.

# re: New version of AJAX Wrapper for .NET

Monday, April 11, 2005 12:45 PM by Pablo
Awesome work!
I've been looking for something like this.

Are you planning to release the source code for the wrapper?

Regards

# re: New version of AJAX Wrapper for .NET

Monday, April 11, 2005 8:42 PM by josh
Do you have a version that doesn't mess with the title of the page? Makes it hard to use it for anything but a toy.

# re: New version of AJAX Wrapper for .NET

Tuesday, April 12, 2005 1:11 AM by Michael Schwarz
Hi Josh, I will upload a new version today. This version will remove the title change for the full version.

# re: New version of AJAX Wrapper for .NET

Tuesday, April 12, 2005 2:34 AM by Machi
The dll can be reversed engineer using even the simplest tool.

# re: New version of AJAX Wrapper for .NET

Tuesday, April 12, 2005 5:26 AM by Adam Heunis
What about security? I.e. How do you know that the post has actually come from the webpage that you think it came from.

Very useful util though!

# re: New version of AJAX Wrapper for .NET

Tuesday, April 12, 2005 6:53 AM by Michael Schwarz
Currently there is no security inside the AJAX.NET Wrapper. I am using forms authentication and this is working for me. Also I had a partner using a AuthenticationTicket that will be used to verify the user authorization.

# re: New version of AJAX Wrapper for .NET

Tuesday, April 12, 2005 9:18 AM by guoqi
It is looks, however, we always want open source things... we dear not use third party component which often give problem in the future...

# re: New version of AJAX Wrapper for .NET

Tuesday, April 12, 2005 9:31 AM by jason
I would have to agree, it would be great to see this as an open source / community supported project (just my thoughts).

- Jason.

# re: New version of AJAX Wrapper for .NET

Tuesday, April 12, 2005 11:45 AM by josh
Thanks Micheal. Appreciate it.

# re: New version of AJAX Wrapper for .NET

Wednesday, April 13, 2005 2:33 AM by Rooc
Just so you know, I found that when posting a textarea field replacing \r\n doesn't work in Firefox because the field only returns \n. In postback you only get the first row.
So I would change the (textfield+'').replace(/\r\n/g,"#rn#")
call to
(textfield+'').replace(/\r/g,"")
(textfield+'').replace(/\n/g,"#rn#")

or a similar call.

gr Rooc

# re: New version of AJAX Wrapper for .NET

Friday, April 15, 2005 7:29 PM by Spineless
Very nice to see someone working on a viable framework for AJAX.

I did a very large XMLHttp project back in 2001. I thought it was great! It takes a different mindset to develop because people have expectations on how a "real" application should be built. I personally thought it was incredible and friggin fast.

One thing I did see is that there appears to be some compatibility issue with Firefox with the demos. Is the problem related to the demo or the library?

Thank you for all your hard work

# re: New version of AJAX Wrapper for .NET

Saturday, April 16, 2005 3:12 PM by Michael Schwarz
Only the demo ist not working correct, I didn't test it, it is only that a click on a button will also reload the page.

# re: New version of AJAX Wrapper for .NET

Friday, April 22, 2005 6:57 PM by Francesco
Is it free to use in commercial products ? What are the licensing terms ?

# re: New version of AJAX Wrapper for .NET

Tuesday, April 26, 2005 2:33 PM by Deepak
I guess this method can be more useful while we r fetching data and not while we want to update some data as it becomes more tedious bcoz we r not able to remember the state while updating during postback.

Please comment

# re: New version of AJAX Wrapper for .NET

Tuesday, April 26, 2005 2:40 PM by Smith
Michael,

I'd like to test drive this library but the zip file appears to be corrupt. Can you please check it and post an update? Thanks.

# re: New version of AJAX Wrapper for .NET

Tuesday, April 26, 2005 5:29 PM by Michael Schwarz
@Smith: can you send me an email (contact form) that I can send you the files? I uploaded the latest release this evening.

# re: New version of AJAX Wrapper for .NET

Tuesday, April 26, 2005 5:30 PM by Michael Schwarz
@Deepak: Can you give me more background information? I think I do not understand what you really mean. Please write me an email with the contact form at this web site.

# re: New version of AJAX Wrapper for .NET

Wednesday, April 27, 2005 5:18 PM by MF
Source code please!

# NOT WORKING in ASP.NET (vb)!!!

Saturday, April 30, 2005 9:22 PM by Eric D. Brown
I keep getting a not defined error for the "<Ajax.JavascriptMethod()>" in the example code (in the documentation). The only options I have are "AjaxMethod", "AjaxRequireSessionState" & "AjaxXmlHttp". What am I doing wrong? Hmmm...

Respectfully,
Eric D. Brown

# re: New version of AJAX Wrapper for .NET

Sunday, May 1, 2005 7:57 AM by Michael Schwarz
Please check the latest example online. The attribute has been renamed to AjaxMethod. Use this instead of JavascriptMethod!

# re: New version of AJAX Wrapper for .NET

Sunday, May 1, 2005 2:17 PM by Eric D. Brown
Thank you Michael! Very nice indeed! :)

Respectfully,
Eric D. Brown

# re: New version of AJAX Wrapper for .NET

Wednesday, May 4, 2005 2:14 AM by Matt
Hi

Using the ServerSideAdd example, my javascript alert pop's up a [object Object] . Any idea on what i am doing wrong would be appreciated

Thank you

# re: New version of AJAX Wrapper for .NET

Wednesday, May 4, 2005 3:10 AM by Michael Schwarz
@Matt: You have to use result.value instead of result. This was a change in one of the last releases, sorry!

# re: New version of AJAX Wrapper for .NET

Wednesday, May 4, 2005 3:22 AM by Matt
Thanks. That worked.

# re: New version of AJAX Wrapper for .NET

Wednesday, May 4, 2005 7:04 AM by Andrea Ramacciotti
Please, strongly name this assembly!