The only problem is the line "CssSelectorClass"... won't validate. Intellisence says it is not a "member of Menu class". I tried changing it to CssClass=, but that certainly didn't work.
The menu displays correctly, but the IDE doesn't like it for some reason.
The CssSelectorClass attribute is what is known as an "expando" attribute. That is, it is an attribute that was invented for the adapter kit; it is not an attribute that is known to the .Net framework natively. Defining expando attributes allows you to add
new attributres to existing ASP.NET tags and then detect those new attributes in your own code (like adapter code) by accessing the control's Attributes collection. As such, it is a super-convenient and flexibly feature in ASP.NET 2.0. However, since the
framework doesn't know that you've added a new (expando) attribute it can't distinguish between an expando and a misspelled attribute. Thus, the IDE sees an expando attribute and thinks, "this is bogus" and flags it as such. You can (and should) simply ignore
such warnings/errors from the IDE.
The CssSelectorClass expando attribute is not passed through into the HTML that is rendered (produced) by the adapters. For example, go to this page,
http://www.asp.net/cssadapters/menu.aspx. Do a "view source" in your browser and search the HTML markup source for CssSelectorClass. You won't find it, though that expando attribute is present in the
server-side <asp:Menu> tag used for that page.
When you talk about "standards compliant" I'm assuming you mean compliant with, say, the W3C standards for XHTML 1.1, etc. Such standards apply to the HTML that is found in the rendered response that the page produces. Since the adapter-related expando
attributes won't be in that HTML that is rendered they do not impact, per se, whether or not the HTML is standards compliant.
VS may show compliance problems (or squiggles) with these expandos because it thinks you have superfluous attributes that may be passed through to the HTML... but for the adapted controls they won't cause true problems because the adapters don't pass these
expandos through.
Hi Russ; thank you for your thoughtful response! Yes, I was referring to W3C standards, and I have extensivly viewed the generated html from the adapters, that's why I never seen the "expando" attribute.
Yes, VS complains as one expects, and at first I was a bit perplexed but you have resolved this for me! I'll pay no attention to the IDE related to this for now.
Thanks again!
Oh and by the way, related to the browser crash item -- I haven't been able to generate anymore crashes since yesterday morning. Hmmmmm...
garyseven
Member
46 Points
40 Posts
CssSelectorClass doesn't validate
Jan 29, 2007 08:07 PM|LINK
Hi folks;
here is an example of how I declare the vertical nav menu in an ascx control:
<asp:Menu ID="LeftNavMenuSiteMap" runat="server" Orientation="Vertical" DataSourceID="LeftNavMenuSiteMapDS" CssSelectorClass="PrettyMenu"></asp:Menu>
The only problem is the line "CssSelectorClass"... won't validate. Intellisence says it is not a "member of Menu class". I tried changing it to CssClass=, but that certainly didn't work.
The menu displays correctly, but the IDE doesn't like it for some reason.
Any ideas?
Thanks!
Russ Helfand
Contributor
3304 Points
744 Posts
Re: CssSelectorClass doesn't validate
Jan 30, 2007 05:54 PM|LINK
Groovybits.com
garyseven
Member
46 Points
40 Posts
Re: CssSelectorClass doesn't validate
Jan 30, 2007 07:23 PM|LINK
Thanks Russ;
I don't know anything about "expando" attributes. I'll have to learn more about that.
Will this validate as standards complient?
Gary
Russ Helfand
Contributor
3304 Points
744 Posts
Re: CssSelectorClass doesn't validate
Jan 30, 2007 08:52 PM|LINK
The CssSelectorClass expando attribute is not passed through into the HTML that is rendered (produced) by the adapters. For example, go to this page, http://www.asp.net/cssadapters/menu.aspx. Do a "view source" in your browser and search the HTML markup source for CssSelectorClass. You won't find it, though that expando attribute is present in the server-side <asp:Menu> tag used for that page.
When you talk about "standards compliant" I'm assuming you mean compliant with, say, the W3C standards for XHTML 1.1, etc. Such standards apply to the HTML that is found in the rendered response that the page produces. Since the adapter-related expando attributes won't be in that HTML that is rendered they do not impact, per se, whether or not the HTML is standards compliant.
VS may show compliance problems (or squiggles) with these expandos because it thinks you have superfluous attributes that may be passed through to the HTML... but for the adapted controls they won't cause true problems because the adapters don't pass these expandos through.
Clear as mud?
Groovybits.com
garyseven
Member
46 Points
40 Posts
Re: CssSelectorClass doesn't validate
Jan 30, 2007 09:54 PM|LINK
Hi Russ; thank you for your thoughtful response! Yes, I was referring to W3C standards, and I have extensivly viewed the generated html from the adapters, that's why I never seen the "expando" attribute.
Yes, VS complains as one expects, and at first I was a bit perplexed but you have resolved this for me! I'll pay no attention to the IDE related to this for now.
Thanks again!
Oh and by the way, related to the browser crash item -- I haven't been able to generate anymore crashes since yesterday morning. Hmmmmm...
sorry for the secret referrence! :)