Calendar buggy styles, and the OOP fix!
Note: this entry has moved.
VGA found a recurrent problem most developers and users of the MS Calendar control seem to have, namely, its poor integration with CSS styles. Being an OOP fan, I clearly see an easy way to solve this problem. Inherit Calendar and change its behavior! That's the cool thing about .NET and the new ASP.NET. It's all too easy:
Cool, huh? The "secret", of course, is the derived writer, which simply
implements a passthrough HtmlTextWriter
descendant which skips
calls to the virtual AddStyleAttribute
and WriteStyleAttribute
methods:
What you get is a calendar without ANY style=""
attributes
whatsoever.
I leave the task of putting this into a library, copying the XSD from the MS
Calendar, installing it under the appropriate VS folder to get intellisense,
and toolbox item attribute to VGA, which excels in the matter ;). The code can
be downloaded from the
ASPNET2 Incubator