65873 members! Sign up to stay informed.

Sponsored Links


Resources

.NET Research Library
Get .NET related white papers, case studies and webcasts

News News News Messages: 11 Messages: 11 Messages: 11 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

New Article on Asynchronous Client Script Callbacks with ASP.NET

Posted by: Paul Ballard on August 11, 2005 DIGG
Paul Glavich has written an article that shows how ASP.NET based asynchronous client script callbacks work without the need for an AJAX moniker or add-on libraries. The article includes source code for creating client callback scripts with ASP.NET 2.0.
There has been a lot of interest in the web-facing community lately about a new useability feature that goes by a number of different names—XMLHTTP, AJAX, out-of-band requests, and asynchronous client script callbacks, to name a few.

Regardless of the name, this feature provides a way for a standard web page to make calls back to the server, without a traditional page refresh. The user is oblivious to the fact that a server call has occurred, and is not interrupted by it.
The article shows how to wire up two lists so that when a list item is selected, an asynchronous post goes to the server and the results update a field on the page. It then shows the ICallbackEventHandler interface and how to use it within a page.

The article also shows the client-side Javascript code necessary to invoke the callback request and to update the page controls with the returned value.
The string value returned from the RaiseCallbackEvent method on the server is passed in via the arg parameter, and the ctx parameter contains contextual information specified via the DoTheCallback method that initiated the asynchronous call—in this example ‘0’. DHTML is used to update the browser display with the text returned from the server.
Read Asynchronous Client Script Callbacks

Threaded replies

·  New Article on Asynchronous Client Script Callbacks with ASP.NET by Paul Ballard on Thu Aug 11 11:24:01 EDT 2005
  ·  that's all fine, but async HTTP is a hack by peter lin on Thu Aug 11 22:46:30 EDT 2005
    ·  It's all a hack! by Paul Ballard on Fri Aug 12 01:43:08 EDT 2005
      ·  I will be with you... by Mileta Cekovic on Fri Aug 12 06:02:41 EDT 2005
        ·  I will be with you... by Paul Ballard on Fri Aug 12 11:39:09 EDT 2005
      ·  It's all a hack! by peter lin on Fri Aug 12 09:53:47 EDT 2005
      ·  It's all a hack! by Mac Ferguson on Mon Aug 15 09:22:50 EDT 2005
    ·  that's all fine, but async HTTP is a hack by Kevin Lewis on Fri Aug 12 10:50:59 EDT 2005
      ·  that's all fine, but async HTTP is a hack by peter lin on Fri Aug 12 11:25:09 EDT 2005
        ·  that's all fine, but async HTTP is a hack by Kevin Lewis on Fri Aug 12 11:30:26 EDT 2005
          ·  right, but I wouldn't use webclient by peter lin on Fri Aug 12 11:40:11 EDT 2005
  ·  Smart clients ? AJAX ? HTML Form and postback ? by Fran?ois Lemaire on Fri Aug 12 02:51:52 EDT 2005
  Message #181095 Post reply Post reply Post reply Go to top Go to top Go to top

that's all fine, but async HTTP is a hack

Posted by: peter lin on August 11, 2005 in response to Message #181019
Let's call async http what it really is. An ugly hack on a request/response communication model to make it look like async calls. the end result is you hammer your server with tons of polling calls. I would think it's easier to just use MSMQ, Biztalk, or Indigo to really do messaging. Considering one can use the .NET hosting infrastructure to process the messages as HTTP, it should be easier and more scalable.

peter

  Message #181109 Post reply Post reply Post reply Go to top Go to top Go to top

It's all a hack!

Posted by: Paul Ballard on August 12, 2005 in response to Message #181095
Picking on Async HTTP as a hack is like pointing out that a rivet is loose on the Titanic. Most web development is a hack and ASP.NET is a HUGE hack. Fundamentally all web development is just request/response, the whole application of a forms based model on top of that with Postbacks, callbacks, etc. is a giant, complicated, and quite ingenius hack.

I say we just get rid of all of this and start developing smart clients! Who's with me? :-)

  Message #181112 Post reply Post reply Post reply Go to top Go to top Go to top

Smart clients ? AJAX ? HTML Form and postback ?

Posted by: Fran?ois Lemaire on August 12, 2005 in response to Message #181019
In my opinion, choosing between these options depends on the project. If you're making an e-commerce juggernaut or a public news site, you'll probably stick with simple postback. If you're making an intranet or extranet application, maybe you will use AJAX or switch to a smart client, but if you really need it. I've spent the last 5 years making web sites often to replace client/server application, and rarely have I felt that using such technologies would really enhance the experience, though I think it's great in some cases.

I guess AJAX or whatever you call it is hyped right now because web sites developers are bored with the actually very simple programming paradigm they use (request/response, request/response, and here we go once again, request/response...). They need some action ! Smart clients introduce a real difference, the ability (or simply the idea...) to work offline : using server resources "smartly". See you in 5 years :)

  Message #181132 Post reply Post reply Post reply Go to top Go to top Go to top

I will be with you...

Posted by: Mileta Cekovic on August 12, 2005 in response to Message #181109
I will be with you when decent framework (like .NET or Java) would exist on more then 50% client OS-es.
Now, it's below 10% sure, probably arround 5% (Java 1.4+ and .NET 1.1 together)

  Message #181170 Post reply Post reply Post reply Go to top Go to top Go to top

It's all a hack!

Posted by: peter lin on August 12, 2005 in response to Message #181109
Picking on Async HTTP as a hack is like pointing out that a rivet is loose on the Titanic. Most web development is a hack and ASP.NET is a HUGE hack.

Fundamentally all web development is just request/response, the whole application of a forms based model on top of that with Postbacks, callbacks, etc. is a giant, complicated, and quite ingenius hack.

I say we just get rid of all of this and start developing smart clients! Who's with me? :-)

You right. it's is all one big hack. Some parts more cool than others. I don't really consider ASP/PHP/JSP a hack. By now, it has gone through several revisions and refinements so that it isn't a hack. others might disagree, but I think it works great for cases where an user session is "mostly stateless" if we forget HTTP session for the moment.

my bias perspective is that HTTP is great for humans, but terrible for pub/sub and real-time applications. I've had people ask, "can you make an ASP application to monitor my servers in real time?"

Then again, doing this all in a RIA would be better to me. Even if google manages to make kick butt user interfaces using AJAX model, I still think the trade off in scalability is well beyond most people's experience and skills. Massive horizontal scalability is rather hard to achieve. A compromise between veritcal and horizontal scaling feels more manageable to me. I wish I knew how google handles all that hardware efficiently.

peter

  Message #181183 Post reply Post reply Post reply Go to top Go to top Go to top

that's all fine, but async HTTP is a hack

Posted by: Kevin Lewis on August 12, 2005 in response to Message #181095
I would think it's easier to just use MSMQ, Biztalk, or Indigo to really do messaging.
How do any of these replace the use of AJAX-like behavior? I can't imagine how one might use MSMQ to fill in a bit of a web page.

  Message #181186 Post reply Post reply Post reply Go to top Go to top Go to top

that's all fine, but async HTTP is a hack

Posted by: peter lin on August 12, 2005 in response to Message #181183
I would think it's easier to just use MSMQ, Biztalk, or Indigo to really do messaging.

How do any of these replace the use of AJAX-like behavior? I can't imagine how one might use MSMQ to fill in a bit of a web page.

Rather than use WebClient or the other call-back mechanisms, you'd write a messaging client to connect to a different server or same server with a different port number.

then it's just a matter of having your messaging client notify the browser using an event. this way, the browser isn't polling continuously to the webserver. it may require opening the firewall to allow for messaging, but at least this way the messaging server can lookup the subscription list for a particlar topic and publish the delta to the right subscribers. it's standard practice.

peter

  Message #181189 Post reply Post reply Post reply Go to top Go to top Go to top

that's all fine, but async HTTP is a hack

Posted by: Kevin Lewis on August 12, 2005 in response to Message #181186
Rather than use WebClient or the other call-back mechanisms ...
But we're talking about web clients, right? If you have to use a web client, what are you going to do? You're not going to get much help from MSMQ there, right?

  Message #181192 Post reply Post reply Post reply Go to top Go to top Go to top

I will be with you...

Posted by: Paul Ballard on August 12, 2005 in response to Message #181132
I think that number might be larger than what your say, but in any case it is increasing for .NET. Vista will have the .NET Framework installed by default.

I heard Billy Hollis give an excellent analogy to why installing the .NET Framework is no big deal. Most computers don't come with Adobe Acrobat Reader on them. But most people install it because it's useful and many things on the web are published with it. So, if the really cool sites require the .NET Framework, people will install it.

  Message #181193 Post reply Post reply Post reply Go to top Go to top Go to top

right, but I wouldn't use webclient

Posted by: peter lin on August 12, 2005 in response to Message #181189
Rather than use WebClient or the other call-back mechanisms ...

But we're talking about web clients, right? If you have to use a web client, what are you going to do? You're not going to get much help from MSMQ there, right?

in that case, you're stuck. If those in charge say, "you must use webclient" and the developers aren't allowed to write a messaging client using MSMQ, or Biztalk, there's nothing you can do. I've heard of plenty of cases where the company had a strict rule and no one was to violate those rules. Even if using a different approach would have provided a better and more scalable solution.

though, one could be sneaky and take the "do it and ask for foregiveness later" approach. software is there to serve the business needs, so it's not always possible to choose the most appropriate solution. It helps if Microsoft officially recommends doing it with messaging instead of AsyncHTTP.

That's my main compliant against AsyncHTTP. MS already has a better solution to solve the problem, but pushing AsyncHTTP promotes bad practices. Well, I consider it bad. I'm sure others will disagree.

peter

  Message #181336 Post reply Post reply Post reply Go to top Go to top Go to top

It's all a hack!

Posted by: Mac Ferguson on August 15, 2005 in response to Message #181109
.I say we just get rid of all of this and start developing smart clients! Who's with me? :-)

{crickets}.

Recent active threads Recent active threads Recent active threads More More More
[Volumes]:Buy and Sell Blackberry 8830 Housing
Transferring current project to Mysql
biztalk workflow/rule engine
I need solutions for below questions
How to data binding ADO.NET DataSet Access or SQL Server DB...
RazorSQL SQL Editor and Database Query Tool Available
Service Pack 2 for TX Text Control RapidSpell .NET 15.0 released
How to create dynamic Folded Corners effect through ImageDraw im
An Evaluation of Windward Reports
More active threads »
Top posters of the weekTop posters of the weekTop posters of the week
This list contains the members who have made the most posts in all forums over the last 7 days:
  1. muthya prasad
  2. SHERRYSLC SHERRYSLC
  3. Richardson Software
  4. Guru Talend
  5. Neodynamic Components
Hot threads Hot threads Hot threads More hot threads More hot threads More hot threads

Eclipse vs. Visual Studio at EclipseCon 2006

Speaking at EclipseCon 2006, Java developer and independent consultant Madhu Siddalingaiah compared Microsoft's Visual Studio IDE to the open source development environment of Eclipse.
(33 comments, last posted July 13, 2009)

Tech Talk: Peter Provost on CAB and Agile development

In this tech talk, Microsoft's Peter Provost talks about the design of the Composite UI Application Block and how the p&p team has led Microsoft in the adoption of Agile methodologies.
(0 comments, last posted April 17, 2006)

Book excerpt: Framework Design Guidelines

Chapter 4 of Framework Design Guidelines, titled "Type Design Guidelines," presents patterns that describe when and how to design classes, constructs and interfaces. In this chapter, Abrams and Cwalina divide types into four groups and discuss the do's and don'ts of type design.
(2 comments, last posted July 07, 2006)

Q&A: Miguel "Mono Man" De Icaza

Paul Ferrill caught up with prime open-source .NET applications driver Miguel De Icaza at Novell's BrainShare conference last week. They discussed the status of Windows Forms for Mono (it's coming along) and VB.NET for Mono (it looks like it's out).
(5 comments, last posted March 30, 2006)

Tech Talk: Jack Greenfield on software factories and DSLs

In this tech talk, Microsoft Visual Studio architect Jack Greenfield discusses the company's approach to Domain-Specific Languages, or DSLs, and the part they play in software factories.
(0 comments, last posted March 15, 2006)
More hot threads »

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
All Content Copyright ©2007 TheServerSide Privacy Policy      Powered by JIVE
Site Map