Ahhh, yes, Microsoft unveiling new ways to put code behind web pages, interchangable Web and Windows controls and controls that have server-side events and can be used just like classic VB... ah wasn't 1998 wonderful....
WHAAAAAA???
I love finding these little bits of MS lore from the depths of time... see if any of this sounds familiar (emphasis all mine) and note the dates!:
David Stutz on WebClasses (June 1998):
“When you start Visual Basic 6.0, you can still, of course, do all the things that you've done in Visual Basic before. But now you can also insert into your project an item called a WebClass. A WebClass represents code that can run on an Internet server. Essentially, it's the ability to put code behind URLs. ”
Try replacing the name “WebClasses“ with “ASP.NET” in this later paragraph (I've helped it along here a bit) doesn't seem to hurt the text a bit:
“We really think that in the future, every application will have a Web component and will deliver part of its functionality through Web browsers. Even standalone applications might choose to use DHTML (Dynamic HTML), for instance, as a UI.
Because of that, it's important to make using server-side code as easy as using a database is in Visual Basic today. The WebClass ASP.NET Designer is very simple. It has a tree view that represents the various pages or entry points on the IIS server. The programming namespace behind those entry points is populated with the same objects that developers use when they program against ASP (Active Server Pages).
As a result, there's very good fidelity between WebClass ASP.NET programming and ASP programming. You use the same Request object, the same Response object, and the same Server object. This commonality between the two will make WebClass ASP.NET programming very easy for people who are used to ASP programming.
To move developers to the world of programming WebClasses ASP.NET, it was very important for us to make programming Internet servers as easy as it is to program Visual Basic forms today. We wanted to have something that would allow Visual Basic programmers who aren't necessarily familiar with HTTP to get up and running very quickly against HTTP servers.”
Hey, wanna merge Win32 and HTTP controls like they are hinting will happen under WinFX? No prob:
“MSDN: Where do WebClasses fit into Microsoft's Windows DNA platform?
Stutz: DNA is a roadmap for building three-tier applications. The top tier is essentially presentation, UI presentation. Two interesting kinds of presentation are HTML and Win32. You can mix and match between them. You can embed HTML within a Win32-style UI or you can embed Win32 controls within an HTML page. Both generic HTML 3.2 and the richer client experience of DHTML are interesting.
The middle tier is the component tier. That's where application logic goes. This is exactly what WebClasses are all about—populating the middle tier with application logic that can be accessed via HTTP, MSMQ, or DCOM.“
How about this all-too familiar feature description:
An Interview with Visual InterDev 6.0 Co-Designer Steve Millet (Sept 2, 1998):
“MSDN: Can you summarize the new scripting object model you helped create for Visual InterDev 6.0?
MILLET: It's an attempt to add a symmetrical programming model for Active Server Page (ASP) programming on the server and Dynamic HTML programming on the client, specifically an Internet Explorer 4.0 client.
MSDN: How does the new object model accomplish this?
MILLET: We've created a set of script components that basically have two implementations: one that runs in Dynamic HTML on the client and one that runs in an Active Server Page on the server.
For instance, a button or a list box can have a traditional control-like interface. That object model is available whether you're targeting the client or the server. In addition, we've created a new set of design-time controls (DTCs) that target these new script objects or components.
By simply dragging and dropping these design-time controls in the new Visual InterDev 6.0 WYSIWYG environment, you get a very Visual Basic-like experience. You can drag a button onto a page, have it expose a click event, and then write an event handler for it.
MSDN: How can an event like a mouse click that fires on the client get processed on the server?
MILLET: That's a good question. This is one of the things the new scripting object model and script components can do for you.
One common task that developers do with HTML and ASP programming is submit to the server a form or event that came from the client, and then use the server to figure out what happened on the client. Visual InterDev 6.0 can do that work for you. It can automatically map a button click on the client to a URL and then into an entry point in your Active Server Page, as if you implemented a button click on the server.”
Hey, I'm not knocking Microsoft here, I'm giving them props for having these ideas years before .NET's implementation of them blew us away. I just can't believe we overlooked them in VS 6.0... maybe the ideas were a little half-baked, and developers like me weren't quite sick enough of marshaling events and data from client to server yet. Still, I find it a bit funny:
An Insider's Look at the New Visual InterDev 6.0 (Sept 2, 1998:
“Visual InterDev 6.0 also lets you compose components that are built in different languages and use them to encapsulate data access or business rules, or integrate other back-end systems, and integrate them into your Web app.”
And the list goes on. The grandfather of Page.Load, anyone?:
The Visual InterDev 6.0 Scripting Object Model Event Sequence (Sept 1998):
“Page Entry Phase
At this point in the execution, all objects have been constructed and initialized...
... Now the page will fire the onenter event. The default event handler, thisPage_onenter, will be invoked first, followed by any other handlers that have been registered via an advise with the thisPage object. The onenter event handler is an ideal location for the programmer to provide initialization code for manipulating the objects in the page.”
And don't believe that IsPostBack was created for .NET either (It's a damn good idea then AND now):
“The thisPage object exposes a property that is especially useful when implementing a handler for the onenter event. This is the firstEntered property. The programmer can use the thisPage.firstEntered property to determine whether this page was entered from some other page, or entered as a result of a roundtrip back to itself. “
Even some of the samples give me an erie feeling of Deja Code...
“function thisPage_onenter()
{
if (!thisPage.firstEntered)
{ // initialize Listbox1 with colors
Listbox1.addItem('red');
Listbox1.addItem('blue');
Listbox1.addItem('yellow');
}
// otherwise Listbox1 state already restored
// do not want to add colors again
}”
Finally, I'll quote THE man himself, Anders Hejlsberg, from March 11th 1998 (speaking about WFC):
“MSDN: What is your vision behind this new WFC application framework?
Hejlsberg: There are actually many things. If I had to name the top three, I would say they are: First, a unification of Windows and HTML as UI metaphors. Second, building a component-oriented framework. Third, allowing you to write real-world Windows applications in Java.“
Interesting that his 1998 vision for WFC is finally coming true (given the recent statements about HTML and Win UI integration in Avalon/Longhorn) but in an even bigger way and with his own language in place of Java.
Anyway I hope you've enjoyed this little trip... it's odd for me to think that the code we now know and love has grown out of the failed or ignored innovations of years past. Cool that MS made it work though! Now why exactly was it that we didn't use this in 1998, again?