Friday, February 3rd, 2006

Creating an Ajax Scribble application with Microsoft Atlas

Category: .NET, Articles

Rama Krishna Vavilala has written up a tutorial on creating an Ajax version of the good ‘ole MFC scribble application.

It walks through creating An Atlas ASP.NET application from scratch, creating a Web service for the backend, and Atlas JavaScript for the front end.

The Atlas Magic

  • It allowed us to write the web application without us making special efforts to make it cross browser. The web service invocation and the client side event handling automatically works on both Internet Explorer and Firefox. The Atlas framework adds the required JavaScript prototypes to Firefox objects to make them look like Internet Explorer objects. The Internet Explorer specific functions like attachEvent and event.offsetX and event.offsetY are made available to Firefox. You can look at AtlasCompat.js file to see how this is done.
  • It automatically created a JavaScript proxy for the Scribble web service methods. The JavaScript proxy script file for an ScribbleService.asmx file has the URL ScribbleService.asmx/js. This is generated by the Atlas HTTP module added in the web.config.

Posted by Dion Almaer at 12:49 am
12 Comments

++---
2.3 rating from 62 votes

12 Comments »

Comments feed TrackBack URI

“The Internet Explorer specific functions like attachEvent and event.offsetX and event.offsetY are made available to Firefox.”

That’s a really interesting alternative to actually implementing and writing to web standards.

But I’m not bitter.

Comment by Mike A. Owens — February 3, 2006

Of course if they had just stuck to standards we might not have XHR today – the old standards double edged sword.

Comment by Dave Johnson — February 3, 2006

Mike Owens, are you people even capable of rational thought? Where did XMLHTTPRequest come from again?

Comment by Rick — February 3, 2006

Mike Owens, are you people even capable of rational thought?

Contrary to rumour, I’m a single person. We’ll try to spread that uninspired insult among us, though.

Where did XMLHTTPRequest come from again?

Rick, the context flew right by you. Advancing the state of technology is a Good Thing. If vendors never stepped outside of existing standards, we’d be stuck with the web circa 1994. Examples of progress made this way include Javascript, <iframe>s, XMLHttpRequest, and more recently the <canvas> and related technologies WHATWG is cooking in a slightly less ad-hoc way.

The strategy Microsoft presents here, however, is stepping on existing standards, by actively encouraging developers to forego the actual W3C DOM event API and write new code to their browser-specific event model.

I’m (marginally) surprised that you fail to see the differences in the situations.

(Just to note, it happens to be really practical to use the wrapping strategy employed here, considering the state of the market. I just thought it was amusing to see Microsofts stance on common standards exhibited so bluntly again.)

Comment by Mike A. Owens — February 3, 2006

Hmmm….Microsoft makes a product that makes cross-browser compatability and a priority and easy to implement and people complain. If google, apple or 37 signals releaed the same people would be overjoyed. But its cool to hate microsoft so…yeah

Comment by Jake — February 3, 2006

Mike, “you people” are the mindless drones that are on Microsoft-bashing auto-pilot.

The strategy Microsoft presents here, however, is stepping on existing standards, by actively encouraging developers to forego the actual W3C DOM event API and write new code to their browser-specific event model.

So it works with Firefox (and other browsers I presume) and you still have a problem with it because it doesn’t prescribe to some official “standard” by the holier than though W3C?

Comment by Rick — February 3, 2006

But its cool to hate microsoft so…yeah

Mike, “you people� are the mindless drones that are on Microsoft-bashing auto-pilot.

OK, guys, I’m going to bow out of this thread as gracefully as possible. I didn’t fully consider my probable audience when making a tongue-in-cheek remark attached to an article like this.

I’ve touched a nerve with people who automatically presume some sort of crusading when criticising a single aspect of single product. This isn’t Slashdot; don’t be so blind to assume that every critique of a Microsoft product is fueled by some sort of juvenile Apple/Google/37signals/whatever chic. It’s embarrasing that such a trivial remark could actually provoke personal attacks from people.

It’s 2006, making “cross-browser compatability a priority and easy to implment” is just the cover charge, and there’s not exactly a shortage of competitors, even within ASP.NET 2.0. As I stated earlier, there’s nothing impractical in their solution, but a new Ajax framework which sees the world as shoe-horned through a 6 year old browser is not exactly forward-looking, regardless of where it comes from.

Comment by Mike A. Owens — February 3, 2006

Does anyone know about a javascript (only) library that will allow you a scribble-style widget? And to go a step further, be able to submit what is in the widget as a jpeg or gif to the server?

Comment by Jim — February 3, 2006

Ajax Scribble application with ASP.NET Atlas

The Code Project has a good tutorial showing how to create an Ajax Scribble application with ASP.NET…

Trackback by Alex Barnett blog — February 4, 2006

The reason why Atlas extends Firefox and Safari to implement the IE APIs and not the other way around is that Firefox and in a lesser extent Safari allow the extension of HTML element prototypes whereas IE does not. Standards have nothing to do with this decision. There is a need to have a consistent API cross-browser to avoid having the rest of the libraries constantly checking for the existence of an API and branching the code. We just chose the only possible way to achieve that.

Comment by Bertrand Le Roy — April 7, 2006

The reason why Atlas extends Firefox and Safari to implement the IE APIs and not the other way around is that Firefox and in a lesser extent Safari allow the extension of HTML element prototypes whereas IE does not. Standards have nothing to do with this decision. There is a need to have a consistent API cross-browser to avoid having the rest of the libraries checking for the existence of an API and branching the code all the time. We just chose the only possible way to achieve that.

Comment by Bertrand — April 8, 2006

Leave a comment

You must be logged in to post a comment.