I'm using the CSS Friendly Control Adapter in my project to make my treeview W#C compliant. It's done that nicely, however, when I run the page through the validator.w3.org checker, it complains about the webresource links for the Adapter related javascript.
The errors are:
===============================================================
Line 34, Column 275: cannot generate system identifier for general entity "t".
…yxepBMgsCRuhTa5CYBsXeTRJyNIlb5PBgss0&t=633481763425116282" type="text/css" re
Line 34, Column 275: general entity "t" not defined and no default entity.
…yxepBMgsCRuhTa5CYBsXeTRJyNIlb5PBgss0&t=633481763425116282" type="text/css" re
Line 34, Column 276: reference not terminated by REFC delimiter.
One of the errors is that the <link> tag is not allowed where it is - it must be in the <head> tag. The Adapter isn't rendering it where it should. I don't know if the other errors would be solved by moving the tag to be inside the <head>, but I suspect not.
Is there a way to get around this ? The whole reason for using the Adapters is to help me with W3C compliance, and it seems to be responsible for failing the W3C validation.
OK, yesterday I managed to get around this for the main menu and hopefully these instructions will help:
1. download the source zip file.
2. Open the project and open MenuAdapter.cs
3. Goto Line 77 (should start "string cssTag = ")
4. Insert the line below to change the ampersand character to the HTML code
filePath = filePath.Replace("&", "&");
5. Goto Line 79 (should start "if (!Page.ClientScript" 6. Insert the lines below to create the header tag
HtmlLink link = new HtmlLink();
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
link.Attributes.Add("href", Page.ResolveUrl(filePath));
7. Goto Line 84 (should start "Page.ClientScript") 8. Replace this line with the one below to write the page header
Page.Header.Controls.Add(link);
9. Goto Line 94 (should start "string cssTag = ") 10. Insert the line below to change the ampersand character to the HTML code
filePath = filePath.Replace("&", "&");
11. Goto Line 96 (should start "if (!Page.ClientScript" 12. Insert the lines below to create the header tag
HtmlLink link = new HtmlLink();
link.Attributes.Add("type", "text/css");
link.Attributes.Add("rel", "stylesheet");
link.Attributes.Add("href", Page.ResolveUrl(filePath));
13. Goto Line 84 (should start "Page.ClientScript") 14. Replace this line with the one below to write the page header
Page.Header.Controls.Add(link);
Looking throught the treeview.cs file you need to be looking to do this around the 220 line number. There only appears to be the one occurance that needs updating. Once done, compile the DLL and refresh your website
Good spotting sf-mandelbug. Hopefully the support team will pick up your fix.
Click "Mark as Answer" on the post that helped you.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
Unfortunately I do not know the express products so would be unable to answer. All I know is that within Visual Studio 2005 its a matter of building the application (compiling the DLL).
I couldn't find an equivalent to the lines you referenced in the MenuAdapter.vb file that I was using -- I think the file was created when I made a new web site using the VSI download for Release 1.0 -- anyway, in THAT version of the MenuAdapter.vb, I found
what appeared to be writing the text for the <a> or <span> and modified that:
Thanks sf-mandelbug, it resolved the HTML validation problem
However when I used a <asp:Menu ID="NavigationList" runat="server" DataSourceID="Sitemap" Orientation="Horizontal" /> control on the page it gives a javascript error:
Member
1 Points
15 Posts
Adapter causes page to fail W3C validation check
Jun 04, 2008 02:32 AM|enotech|LINK
I'm using the CSS Friendly Control Adapter in my project to make my treeview W#C compliant. It's done that nicely, however, when I run the page through the validator.w3.org checker, it complains about the webresource links for the Adapter related javascript. The errors are:
===============================================================
Line 34, Column 275: cannot generate system identifier for general entity "t".
Line 34, Column 275: general entity "t" not defined and no default entity.
Line 34, Column 276: reference not terminated by REFC delimiter.
None
0 Points
3 Posts
Re: Adapter causes page to fail W3C validation check
Jul 09, 2008 03:23 AM|sf-mandelbug|LINK
OK, yesterday I managed to get around this for the main menu and hopefully these instructions will help:
1. download the source zip file.
2. Open the project and open MenuAdapter.cs
3. Goto Line 77 (should start "string cssTag = ")
4. Insert the line below to change the ampersand character to the HTML code
5. Goto Line 79 (should start "if (!Page.ClientScript"
6. Insert the lines below to create the header tag
7. Goto Line 84 (should start "Page.ClientScript")
8. Replace this line with the one below to write the page header
9. Goto Line 94 (should start "string cssTag = ")
10. Insert the line below to change the ampersand character to the HTML code
11. Goto Line 96 (should start "if (!Page.ClientScript"
12. Insert the lines below to create the header tag
13. Goto Line 84 (should start "Page.ClientScript")
14. Replace this line with the one below to write the page header
Looking throught the treeview.cs file you need to be looking to do this around the 220 line number. There only appears to be the one occurance that needs updating. Once done, compile the DLL and refresh your website
Hope that helps a bit
Menu css friendly adapters W3C Validation Check
All-Star
44551 Points
13496 Posts
MVP
Re: Adapter causes page to fail W3C validation check
Jul 09, 2008 04:18 AM|TATWORTH|LINK
Good spotting sf-mandelbug. Hopefully the support team will pick up your fix.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
None
0 Points
7 Posts
Re: Adapter causes page to fail W3C validation check
Jul 22, 2008 05:35 PM|aezzell|LINK
Yes, good catch--thanks.
Now, could you perhaps answer a really bone-headed question for me?
I'm using VWD Express 2008. How do I "compile the dll"? Do I have to use csc.exe? If so, what's the correct syntax?
Sorry if this is a really obvious question. I'm still very new to ASP.NET and have only recently stumbled across the CSSFriendly Adapters.
Thanks!
None
0 Points
3 Posts
Re: Adapter causes page to fail W3C validation check
Jul 23, 2008 03:44 AM|sf-mandelbug|LINK
Unfortunately I do not know the express products so would be unable to answer. All I know is that within Visual Studio 2005 its a matter of building the application (compiling the DLL).
None
0 Points
7 Posts
Re: Adapter causes page to fail W3C validation check
Jul 25, 2008 07:56 PM|aezzell|LINK
Hi, again!
I couldn't find an equivalent to the lines you referenced in the MenuAdapter.vb file that I was using -- I think the file was created when I made a new web site using the VSI download for Release 1.0 -- anyway, in THAT version of the MenuAdapter.vb, I found what appeared to be writing the text for the <a> or <span> and modified that:
There's a BuildItem sub, and line 187 was:
writer.Write(item.Text)
So I inserted this before it:
item.Text = Replace(item.Text, "&", "&")
writer.Write(item.Text)
And now my pages validate!!!!
Thanks for getting me started in the right direction.
None
0 Points
3 Posts
Re: Adapter causes page to fail W3C validation check
Jul 28, 2008 02:42 AM|sf-mandelbug|LINK
Fantastic, well done on getting the VSI converted :-)
None
0 Points
2 Posts
Re: Adapter causes page to fail W3C validation check
Mar 11, 2009 01:19 PM|jellyrim|LINK
Thanks sf-mandelbug, it resolved the HTML validation problem
However when I used a <asp:Menu ID="NavigationList" runat="server" DataSourceID="Sitemap" Orientation="Horizontal" /> control on the page it gives a javascript error:
Line:2
Char:1
Error:Syntax error
Code:0
Anyone can help?
css adapters friendly 2008 menu control 3.5