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
30 Comments
Comments have been disabled for this content.
Julien said
Great software, Michael!! Is the wrapper working with all .NET languages?
Ulli Devuru said
Super, genau das, wonach ich schon lange suche!! PRIMA!!!!!
ttyp said
why don't you share your code?
sean said
any chance to support array of object?
Michael Schwarz said
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.
Pablo said
Awesome work!
I've been looking for something like this.
Are you planning to release the source code for the wrapper?
Regards
josh said
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.
Michael Schwarz said
Hi Josh, I will upload a new version today. This version will remove the title change for the full version.
Machi said
The dll can be reversed engineer using even the simplest tool.
Adam Heunis said
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!
Michael Schwarz said
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.
guoqi said
It is looks, however, we always want open source things... we dear not use third party component which often give problem in the future...
jason said
I would have to agree, it would be great to see this as an open source / community supported project (just my thoughts).
- Jason.
josh said
Thanks Micheal. Appreciate it.
Rooc said
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
Spineless said
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
Michael Schwarz said
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.
Francesco said
Is it free to use in commercial products ? What are the licensing terms ?
Deepak said
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
Smith said
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.
Michael Schwarz said
@Smith: can you send me an email (contact form) that I can send you the files? I uploaded the latest release this evening.
Michael Schwarz said
@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.
MF said
Source code please!
Eric D. Brown said
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
Michael Schwarz said
Please check the latest example online. The attribute has been renamed to AjaxMethod. Use this instead of JavascriptMethod!
Eric D. Brown said
Thank you Michael! Very nice indeed! :)
Respectfully,
Eric D. Brown
Matt said
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
Michael Schwarz said
@Matt: You have to use result.value instead of result. This was a change in one of the last releases, sorry!
Matt said
Thanks. That worked.
Andrea Ramacciotti said
Please, strongly name this assembly!