E
Electrified Research
The new ASP.NET 2.0 Menu control seems to have some very cool features.
But there are some things I don't like. Heavy implimentation of
inline style. Some of which I cannot remove. The <a> tags all
implement style="cursor:text". The stylesheet in the header begins to
get larger and larger as you create a more complex menu and apply
styles.
I like the menu archatecture but what I want to do is two things:
1. REMOVE ALL STYLE DEFINITIONS WITHIN THE PAGE.
2. REMOVE ALL INLINE STYLES WITHIN THE MENU.
It would be also nice to:
3. REMOVE ALL INLINE EVENT HANDLER DEFINITIONS.
eg. onmouseover="Menu_HoverStatic(this)"
So far I only see my options being re-writing the entire control
hopefully inheriting from it and reusing as much functionality as
possible. The rendering of the menu is somewhat black box and I'm not
sure what all goes on during the OnPreRender method. I know that if I
override the OnPreRender without executing base.OnPreRender the style
definitions for the Menu control disapear. GREAT! That takes care of
#1, but what else does it mess with.
Any help would be great. But if anyone feels that this is just too
much effort in hopes of cleaning up HTML, I'd love to hear it.
My experience with building high traffic websites has put me in the
belief that every byte counts and any possibility of removing
unneccesary code should be explored
Note that what I intend to do is use class="[name]" to apply all styles
and apply behaviors (onmouseover, etc) by parsing the document tree and
applying the event handlers, etc, etc. I'm already doing this with
other websites.
Again, any help, resources, or opinions welcome.
But there are some things I don't like. Heavy implimentation of
inline style. Some of which I cannot remove. The <a> tags all
implement style="cursor:text". The stylesheet in the header begins to
get larger and larger as you create a more complex menu and apply
styles.
I like the menu archatecture but what I want to do is two things:
1. REMOVE ALL STYLE DEFINITIONS WITHIN THE PAGE.
2. REMOVE ALL INLINE STYLES WITHIN THE MENU.
It would be also nice to:
3. REMOVE ALL INLINE EVENT HANDLER DEFINITIONS.
eg. onmouseover="Menu_HoverStatic(this)"
So far I only see my options being re-writing the entire control
hopefully inheriting from it and reusing as much functionality as
possible. The rendering of the menu is somewhat black box and I'm not
sure what all goes on during the OnPreRender method. I know that if I
override the OnPreRender without executing base.OnPreRender the style
definitions for the Menu control disapear. GREAT! That takes care of
#1, but what else does it mess with.
Any help would be great. But if anyone feels that this is just too
much effort in hopes of cleaning up HTML, I'd love to hear it.
My experience with building high traffic websites has put me in the
belief that every byte counts and any possibility of removing
unneccesary code should be explored
Note that what I intend to do is use class="[name]" to apply all styles
and apply behaviors (onmouseover, etc) by parsing the document tree and
applying the event handlers, etc, etc. I'm already doing this with
other websites.
Again, any help, resources, or opinions welcome.