Logo Home   Downloads   Up to Bluedog Limited
On the final approach to Beta 2
Posted on 5/2/2006 4:10 PM by Maurice Prather

Invariably one of the common questions I receive is "what do I need to do to get ready for Beta 2?

The answer is very simple - learn ASP.NET 2.0.

It's a simple concept - the more you know about Whidbey, the more you know how WSS v3 operates. 

WSS v2 utilized ASP.NET 1.1 and as a result had some interesting rendering quirks, whereas WSS v3 is built on ASP.NET 2.0.  There's a huge difference between the words utilized and built.

Here's a few examples that highlight the "built on ASP.NET 2.0" concept...

Working on the product itself...
Want to work on my team (developer platform - rendering, WebParts, SafeControls, compiled pages, etc)? The last person hired on my team was simply given an Asp.net 2.0 book and told that assignment #1 was "go learn Whidbey". 

WebParts
In the past, WebParts were distinctly a SharePoint-only entity.  With Asp.net 2.0, that is no longer true.  The Asp.net team adopted the concept of WebParts and reworked the framework to provide a system that can be used in all Asp.net sites.  If you want to learn about WebParts, all you have to do nowadays is open up any Asp.net 2.0 development book.

Does v3 utilize Asp.net WebParts? Yes.  The entire v2 framework was completely rewired to rely on Asp.net's WebPart framework.  This gargantuan effort took well over 10 months.  The net result is that all the goodness of Asp.net's framework is natively available in WSS.

WebPart Connections
I want to call out this feature of WebParts out because it's truly one of features that changed from top to bottom between "then" and "now".  The v2 implementation of connections was a very complicated, fault intolerant, delegate based system.  I was honestly never a fan of the operational model that we chose way back in 2001.  The number of hoops required by a developer to get a WebPart connected was simply ridiculous.

When the Whidbey team began formulating the new WebPart framework, they looked at the v2 connections model and laughed.  Rightfully so.  Interestingly enough, they liked our "page dictator" model that we scrapped due to complexity and time requirements.  The second, less ambitious model is what was shipped with v2.

In effect, the "page dictator" became the WebPartManager... and the connections framework was switched over to a reference based system.  If you were leery of WebPart connections in v2, I don't blame you but you should really check out the new model that is offered by Asp.net 2.0.  It's not only easier, it's also much more robust.

The big "takeaway" when using Asp.net connections instead of WSS connections is the lack of client-side connections and cross-page connections.  I don't believe this is a big deal for most developers.  For client-side connectivity, you can can craft custom javascript or even utilize Ajax (as you would for any generic Asp.net site).  For cross-page connections, there are number of generic solutions out there which allow you to pass data from page to page.  If custom solutions don't work, you can always fallback and use WSS WebParts. 

No more ISAPI filter!!
One of the first things that you will notice when you install WSS v3 is the departure of the ISAPI filter.  This one change is massively huge, both to you as an admin and you as a developer. 

As everyone knows, the isapi filter was used to determine whether or not a given request's content existed on file system.  This junction point was where the entire "is it ghosted or not ghosted" conversation began.  For v2 reference, check out the post Ghosted and unghosted pages

The "missing" isapi filter is perhaps the biggest clue as to the power of Asp.net 2.0 and how WSS is built on top of a truly robust system.  To be clear, the functionality of the filter still exists but the filter itself was replaced by two key mechanisms...

  • VirtualPathProvider - this Asp.net 2.0 class allows WSS to determine where to retrieve content from (e.g. database or the filesystem).
  • CompilationMode - the Page class now contains a new property that describes whether or a page can contain inline code.  The net effect is that the Page class can operate with the same intent as v2's SafeMode parser, which provided WSS the capability on disallowing code on unghosted pages.  This new feature of the Asp.net parser is huge!  WSS no longer needs to build and maintain its SafeMode parser - instead we squarely rely on Asp.net to handle parsing and page characteristics when compilation modes are changed.

What are the other benefits of removing the isapi filter? 

  • For developers, the ability to more natively interact with HttpModule and HttpApplication classes without having to worry about the filter preempting everything is super nice.
     
  • For administrators, the number #1 nice thing is that all requests will be recorded properly in the IIS log files.  This is a huge win for metrics. 

Gone are the days of usage reports that look like...

#reqs %bytes last time file
2,265,813 20.65% Apr/19/06 1:16 AM www.bluedoglimited.com/_vti_bin/owssvr.dll

Instead, your IIS log-based reports will start looking like...

#reqs %bytes last time file
65,813 8.20% Apr/19/06 1:16 AM www.bluedoglimited.com/code/snippets.zip

Better resolution... long gone are the days of vague owssvr.dll entries!  Granted you will continue to have some owssvr.dll entries, but those will be limited to actions that actually call into the dll.

SafeControls
Everyone loves SafeControls, right?  Well, did you know that Asp.net 2.0 can control whether or not a type is instantiated?  That's right... check out the PageParserFilter class.  WSS maintains the list of "safe" controls (both compiled and user controls); Asp.net 2.0 provides the mechanism which allows enforcement to occur.

Unghosted pages that actually compile?
In v2, once a page was unghosted it was forced through the SafeMode parser.  This inevitably meant the page was not allowed to contain inline code.  In v3, the "no code on page" behavior is still the default behavior.  However, thanks in large part to Asp.net's framework, it is possible to render an unghosted page that contains inline code.

Is this a highly privileged action? Yes - only server admins can allow this type of behavior. 

Does it seem scary from a security standpoint?  Absolutely - this is without one of the scariest operation that can be enabled by a server administrator.  Because of the nature of this feature, there is only way to activate this feature... the server administrator must manually turn on the functionality (i.e. there's no object model or browser interface).  The plus side to this functionality is that server owners will be able to push their unghosted customizations in directions never before attainable.

Master Pages
Themes and site presentation/layout was always one of the biggest headaches in v2.  If you want to see how to quickly update the look of any Asp.net 2.0 site, look into Master Pages.  It will undoubtedly the way you design a site... and help you understand how to v3 sites rely on Master Pages.

User Controls
Another artifact of relying of completely relying on Asp.net 2.0 to handle rendering is the ability to easily use *.ascx user controls.  This is a huge win for both the product itself as well as developers building custom solutions on top of WSS.  Every control that is utilized by WSS is available to all page authors.  All controls are subject to the SafeControls processing and validation.

The only feature that WSS does not support is the ability to drop any user control into a WebPartZone.  On a standard Asp.net site, any control can become a WebPart when it is dropped into a WebPartZone - under the hood, Asp.net wraps the control in a GenericWebPart.  I honestly feel this is a small difference in behavior between a pure Asp.net site and WSS site that will not be encountered by many folks.

Authentication providers
 
Need an alternate means of authenticating your users?  Want to implement Forms authentication or perhaps tie into a custom solution?  Leverage Asp.net's Membership and Roles features.

There you have it... a quick overview of how WSS v3 is built on top ASP.NET 2.0. 

-Maurice

Additional resources:

re: On the final approach to Beta 2
With the ISAPI filter gone in v3, will it be easier to deploy other web apps on the same server as WSS v3? I am doing battle with WSS v2 to get my web apps to run and the SharePoint Admin Guide isn't of much use.
Randy Schmidt @ 5/4/2006 6:40 AM
Great Post!
This is one of (if not the) most concise post I have seen on upcoming features.
I am really looking forward to when we get the green light to write production code against 2007.
Cheers, and AWESOME job! - Shane
Shane Perran @ 5/5/2006 8:51 AM
ascx controls
You mentioned the ability to use ascx controls in WSS. How would you do that? You can't import the ascx files into a web part gallery? I know it can't be added via stsadm. I tried compiling the web page with the user controls wrapped in GenericWebPart class hoping I could grab the DLL and add it to a web part library but it didn't work. So how does one add a user control to a WSS page web part zone??
Tim @ 5/8/2006 12:21 PM
re: On the final approach to Beta 2
I've been looking around in discussion groups and lots of blogs, but i
can't find the answer to my question:

Is it possible to use the Sharepoint Services (v3) web parts in a
regular ASP.NET 2.0 website to make use of the WSS functionality? Like
shared documents, (event/taks) Lists etc.

I understood that ASP.NET 2.0 web parts would work on WSS, but how
about the other way around? I would like to integrate the WSS
functionality into an existing web app.

 
Victor @ 5/11/2006 5:18 AM
re: On the final approach to Beta 2

Randy: Deployment in general is much more organized as well as easier in v3.

Tim: You would use ASCX controls in v3 as you would in any other aspx page.  The only limitation is that you will not be able to drag an ASCX control into a web part zone (which is called out in the post). 

Victor: No - if your web parts inherit from Microsoft.SharePoint.WebPartPages.WebPart, you will need to use the WebPart on a WSS site.  You can however create an Asp.net WebPart that will operate on both a generic Asp.net site and WSS site. 

Maurice Prather @ 5/15/2006 9:53 PM
re: On the final approach to Beta 2
Maurice - In your post, you refer to the v2 WebPart connections infrastructure being more of a "delegate based system" where as the ASP.NET 2.0 /WSS v3 infrastrcture is more "reference based". Any chance you can elaborate on this?
 
I take it you mean that if you were going to do WP connections in v2, the two "connectable" WP's would have to open themselves up for a "event-like subscription" whereas the WebPartManager in ASP.NET 2.0 handles all references to WP's and this, making a connection is done through the WebPartManager class... would you consider this correct (or would you clarify/add something)?
AC [MVP MCMS] @ 5/24/2006 11:31 AM
re: On the final approach to Beta 2
I have a comment on web part connections within sharepoint. It is possible to pass a parameter value from a filter to a Excel WP. It would be desirable to use the Form web part to pass parameters to Excel. The Form web part allows more adaptable methods for interaction (drop down lists, check boxes etc). Currently a Form WP can only pass the name of an object within the spreadsheet to the Excel WP. Why is this the case?
Tom @ 5/26/2006 7:57 AM
re: On the final approach to Beta 2
Andrew: You are correct. The difference between v2 and v3 connections is quite large in how the connections are formed and processed.  Instead of working with event handlers, the v3 model relies on the using/passing the web parts themselves.
 
Tom: The SimpleFormWebPart implements the IRowProvider connection interface.  This part was created in the v2 timeframe and therefore any connectability it has with the v3 Excel WebParts is coincidental (sort of).  There is chance you're referring to something other than the SFWP....
Maurice Prather @ 6/1/2006 10:51 AM
re: On the final approach to Beta 2

While the new reference connections approach may be more robust than the delegate connections approach, I'm concerned about the loss of standard cross-vendor cell/row/list paired interfaces. It seems to me that the idea that vendor agnostic Web Parts will be able to connect in unanticipated ways at run time was lost in the upgrade.
 
My other concern has to do with the loss of the ClassResourcePath to a file system-based set of resources. I have found exceptional value in deploying both static class resources like images, JavaScript, CSS, and even a web.config as well as dynamic class resources like ASPX pages with server-side script and ASMX files (DLLs to the bin). Seems like we lost the later with .NET 2.0 Web Parts. Perhaps Solutions will make up for this loss.
 
<Todd />

Todd Bleeker @ 6/5/2006 7:16 PM
re: On the final approach to Beta 2
Maurice,
 
Thank you for your post... unfortunately some of your assumptions are dead wrong. The inability to use user controls in webzone via the generic wrapper is a HUGE step back and will adversely impact a large number of users... user controls are easy to build... web parts are very manual... I would suspect most people building "web parts" for asp.net 2.0 are actually building user controls and relying on the generic wrapper to place in web part zones.  If Microsoft does not correct this oversight I will have wasted the last year and a half of development.  Please take this request back to the powers that be -- thanks
Andrew Beery @ 7/20/2006 7:29 AM
Microsoft Certified Master
Are you looking for a team of SharePoint experts?
ShareSquared can help ... drop us a note.
 
 
ShareSquared, Inc.
MVP Logo
Keyword Search
 
View by category
 

Disclaimer:
The contents of this site represent thoughts and opinions of the authors , not those of anyone else - such as past, present and future employers.  This a forum of the exchange of ideas centered on SharePoint technologies.  It is not a support channel.  :)

Copyright © 2004-2009 BluedogLimited.com. All rights reserved.