AJAX .NET Wrapper DLL Video

Because I do not have time to write a documentation I added a small video that will show you how to use the AJAX .NET Wrapper DLL. First I will show the old way using postbacks to the Server. Two textboxes (username and password) will be verified on the server. If the username is not michael and the password is wrong I will show a error message. Please note that every click on the Login button will start a postback (server round trip).

I change the code and add some Javascript lines. Now, the browser will not refresh the page after clicking on Login. You have seen how easy it is to add the AJAX .NET Wrapper to existing code!!

The second sample in this video will show you how cool it is to return your own class. You will be able to use nearly the same syntax as you use it with C#. I am using the JSON (Javascript Object Notation) that will work in Firefox, Mozilla and Internet Explorer.

Download the video as a zip: http://ajax.schwarz-interactive.de/download/ajaxvideo.zip
View the video online: http://ajax.schwarz-interactive.de/download/ajax.wmv

Published Monday, April 11, 2005 11:44 PM by Michael Schwarz

Comments

# re: AJAX .NET Wrapper DLL Video

Monday, April 11, 2005 8:04 PM by PeterNZ
Sorry Mate but I can't unzip the file. I'll get a

"Error in file #1: bad Zip file offset (Error local header signature not found): disk #1 offset: 0"

I wonder if others have teh same problem and ther's someting wrong with the zip file.

Cheers

Peter

# re: AJAX .NET Wrapper DLL Video

Monday, April 11, 2005 8:32 PM by Samboy Lims
Thanks for the demo. What happens if you change page after executing an asynchronous call?

Sometime ago, I also played on a similar capability by Alvaro Mendez ( http://www.codeproject.com/aspnet/AlvaroRemoteScripting.asp ) but this is a different approach I should say.

# AJAX Wrapper for .NET

Monday, April 11, 2005 11:47 PM by TrackBack

# re: AJAX .NET Wrapper DLL Video

Tuesday, April 12, 2005 1:06 AM by Michael Schwarz
Sorry, there was an error while uploading the ZIP file. I have started the upload of the new ZIP file. In 10 minutes the new file should be on the server...

# re: AJAX .NET Wrapper DLL Video

Tuesday, April 12, 2005 1:06 AM by Michael Schwarz
If you change the page after invoking the method on the server will have no effect for the execution. The method will finish and trying to return the result. But there will be no client request running and the result will be trashed...

# re: AJAX .NET Wrapper DLL Video

Tuesday, April 12, 2005 1:58 PM by Ashish Jaiman
if you have "." in the namespace an error is thrown
do
<script language="javascript" src="vbwrapper/common.ashx"></script>
<script language="javascript" src="vbwrapper/X.Y.test,X.Y.ashx"></script>

throws an exception

great work btw

# re: AJAX .NET Wrapper DLL Video

Tuesday, April 12, 2005 2:20 PM by Christoph
hi

I got an exception when I call
csharpwrapper/WebForm1,CSharpSample.ashx in Browser. I use the examples in csharp.


by Christoph

[ArgumentNullException: Wert darf nicht Null sein.
Parametername: type]
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +301
Ajax.JavascriptHandler.ProcessRequest(HttpContext context) +266
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87

# AJAX Wrapper for .NET

Tuesday, April 12, 2005 2:57 PM by TrackBack
TrackBack From:http://www.cnblogs.com/gxh973121/archive/2005/04/13/136516.html

# re: AJAX .NET Wrapper DLL Video

Tuesday, April 12, 2005 4:49 PM by Michael Schwarz
@Ashish Jaiman: Can you please send me the sample VB.NET class file? Or the VB.NET project files? Are you missing the web.config httpHandler setting?

@Christoph: Can you send me the project you are using? Are you using the sample solution?? Are you using a IIS root application or a virtual folder?

# re: AJAX .NET Wrapper DLL Video

Wednesday, April 13, 2005 3:01 AM by Christoph
I use the csharp-default as is in an existing project(copy and added the httpHandler-lines in web.config. I use it in an virtual folder /localhost/smspower/default.aspx

# re: AJAX .NET Wrapper DLL Video

Wednesday, April 13, 2005 2:26 PM by Ashish Jaiman
where do i send the erroring out project
but to recreate it is very simple ( or may be i don't know what to change in the javascript registration on the page) but if you change the name of the assembly to VBNETSample.UI ( fromt he project properties) it blows up - i guess i am using the invalid script registration

<script language="javascript" src="vbwrapper/common.ashx"></script>
<script language="javascript" src="vbwrapper/VBNETSample.UI.WebForm1,VBNETSample.ashx"></script>

thanks a lot

# re: AJAX .NET Wrapper DLL Video

Wednesday, April 13, 2005 2:41 PM by Michael Schwarz
@Ashish: the current release will not need to add those script TAG lines. You can use Ajax.Utility.RegisterTypeForAjax(typeof(WebApplication1.WebForm1)); This method will write both of those lines!!

I will upload a documention for the Ajax.NET Wrapper DLL this night.

# AJAX Wrapper for .NET

Wednesday, April 13, 2005 8:58 PM by TrackBack
So much for fast speedy interactivity on the web. Here comes AJAX Wrapper for .NET (v1.1). No more postbacks!...

# re: AJAX .NET Wrapper DLL Video

Thursday, April 14, 2005 11:56 AM by Ashish Jaiman
even registering for javascript wont' work - it throws an exception if there is a . in the assembly name - like VBNETSample.UI

Ajax.Utility.RegisterCommonAjax()
Ajax.Utility.RegisterTypeForAjax(Me.GetType)

# re: AJAX .NET Wrapper DLL Video

Thursday, April 14, 2005 4:45 PM by Michael Schwarz
Hello Ashish, it is working with a dot in the assembly name. I think you have to register something like WebApplication1.WebForm1 instead of Me.GetType. ASPX files will be compiled to another class that will be there only temporary. Can you send me a sample where it is not working?

# re: AJAX .NET Wrapper DLL Video

Thursday, April 21, 2005 11:07 PM by liming
I have having the same problem as Ashish, I'm running my application under the virtual directory "testmanager"

this is what's generated using RegisterTypeForAjax

<script language="javascript" src="/testmanager/ajaxwrapper/common.ashx"></script>

<script language="javascript" src="/testmanager/ajaxwrapper/testmanager.Objects.UIL.Login.Login,testmanager.ashx"></script>

I have a code behind method under the class "Login.cs" in the namespace

"testmanager.Objects.UIL.Login"




[Ajax.JavascriptMethod()]
public bool CheckUsername(String username)

but in my own javascript, when I called "CheckUsername", it was told to be not defined.

HELP! I'm only one step away from ajax.

# re: AJAX .NET Wrapper DLL Video

Friday, April 22, 2005 12:48 AM by liming
Actually, I found out what the problem is..

I have my global.asax code behind file and in the

Application_PreRequestHandlerExecute

I have my custom logic. For some reasons, it causes conflicts with the ajax httphandler. I'm not sure why. Here is what I have in this method.

protected void Application_PreRequestHandlerExecute(Object sender, EventArgs e)
{
string loginurl = "~"+System.Configuration.ConfigurationSettings.AppSettings["LoginUrl"];
bool showlogin = false;
//objResponse.Write("i'm here "+objRequest.Path);
String url = Request.RawUrl;
Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
if (Session["name"] == null)
{
// Not a login page
if (!url.EndsWith("Login.aspx") && !url.EndsWith("Modules/System/Error.aspx"))
{
showlogin = true;
}
}

if(showlogin==true)
{
Response.Redirect(loginurl,true);
}
}

# re: AJAX .NET Wrapper DLL Video

Monday, May 09, 2005 12:16 PM by skeps
Does anyone have any tips or links to any url's with info on using ajax to upload files?

# ????????????????????? &raquo; Blog Archive &raquo; Ajax?????? ???????????????

PingBack from http://www.neuq.net/www/fish/blog/?p=9

# My Dream | dream of our own &raquo; Ajax??????&#8211;???????????????[????????????]

PingBack from http://ccst.jlu.edu.cn/~w01f/dawn/?p=16

# AJAX资源汇集(转载)

Thursday, July 05, 2007 9:54 PM by earlier

functionStorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().te...

# ajax

Wednesday, July 25, 2007 10:29 PM by hq2008

AJAX相关资料 CSDNBlogAjax文章搜索:search.csdn.net/.../%E4%B8%93%E9%A2%98:Ajax技术应用开发http://www.51...