From: Brian @ A. <br...@aj...> - 2006-03-21 16:49:56
|
I began to mind when I'd spent many weeks in discussion and testing with my Indian subcontractors to get a large web application to pass the W3C validators so that that site could carry the "XHTML" and "CSS" and "WAI-AAA" badges, only to find that as soon as I added Anthem controls to a simple page I lost all my validation ticks. I found the solution and made the suggestion but when it was pointed out that the integral ASP.Net hidden fields all use the same invalid identifiers I decided to drop my campaign. I don't know why the W3C validators and Tidy let the Microsoft "__*" identifiers through and object to others, but that's another issue. Now on revisiting it, and having seen some press about Microsoft's stated intention to make IE7 standards compliant, I'm thinking that they could easily issue a patch to the framework to replace all their double underscores and generate valid IDs for the __EVENTTARGET and __EVENTARGUMENT and __VIEWSTATE hidden fields. If they do that, and Anthem continues to use the invalid double underscores, then Anthem could get the blame for lots of invalid HTML. I'll pick up the latest snapshot today, and locate the required changes and email you the relevant lines to change, if you don't mind. I tried CVS and couldn't get my head around it :-/ Per my original suggestion, I propose replacing the invalid "__*" with a valid "AJAX_*" That would clearly identify to any human reader trying to step through or debug the code that this element is peculiar to an AJAX addition to the page. I'm equally happy to make it Anthem_ to give Jason some recognition for his fantastic development, but I wondered if that would be as clear to anyone coming later to review the generated code. Would they necessarily know that Anthem was an implementation of AJAX? I'm a firm believer also in Alzheimer's law of programming: "After 3 weeks you forget why you used that identifier or construct, so your names and comments need to be very, very clear." So, unless anyone objects loudly (and quickly), I'm going to recommend changing the invalid "__" to a valid "AJAX_". Code will follow. Brian Lowe, AJP Interactive w: www.ajpi.co.uk <http://www.ajpi.co.uk/> e: br...@aj... f: 07075 167630 _____ From: ant...@li... [mailto:ant...@li...] On Behalf Of Manu Temmerman-Uyttenbroeck Sent: 21 March 2006 09:24 To: br...@aj... Cc: Roberto; ant...@li... Subject: Re: [Anthem.NET-users] Anthem generated code and HTML Tidy I personally don't really mind this invalid html. But if you really do mind, I don't mind changing it :) Could you therefore maybe submit a patch on sourceforge? It will save me time to do it. Or send me a mail with what I have to change where. Pls download first the latest snapshot so we are using the same code... Could you do this for me? Manu. On 3/21/06, Manu Temmerman-Uyttenbroeck <man...@gm...> wrote: Ok Brian. If I'll find the change I'll check in the change tonight. I hope it won't break any code though... Hmm on second thought... I won't check it in. Could you maybe make some testing for this? If you can assure me that it won't break anything, then I'll check it in. Manu. On 3/21/06, Brian @ AJP <br...@aj...> wrote: If you follow the W3C recommendation for HTML and XHTML you will find that an identifier must begin with a letter, not a number or underscore, so the ASP.Net 'standard' hidden fields do use invalid HTML, and so you can expect all ASP.Net pages to fail this validation test. (I don't know why Tidy doesn't highlight "__EVENTTARGET" and "__EVENTARGUMENT" - maybe there's a switch in it that turns a blind eye to it because it knows it's Microsoft.) I suggested a fix for the anthem-generated element IDs by simply changing a couple of lines of code in manager.cs, but didn't press it because fixing it seemed pointless in light of the major Microsoft invalidations. Now I'm thinking it should be fixed while we know about it and how to fix it. The alternative is to carry on with known invalid generated IDs. If Microsoft (newly committed to 'compatibility' and 'standards') issues a patch to the ASP.Net framework that fixes their invalid IDs, then Anthem would be left out in the cold and would be to blame for invalidating otherwise valid mark-up. What does the team think? Brian Lowe, AJP Interactive w: www.ajpi.co.uk <http://www.ajpi.co.uk/> e: br...@aj... f: 07075 167630 _____ From: ant...@li... <mailto:ant...@li...> [mailto:ant...@li...] On Behalf Of Manu Temmerman-Uyttenbroeck Sent: 21 March 2006 06:32 To: Roberto Cc: ant...@li... Subject: Re: [Anthem.NET-users] Anthem generated code and HTML Tidy Brian Lowe asked the same question 11th of February. This was my answer then: Your pages are invalid because of id attributes that start with "__", correct? If so, then I'm a little bit confused. In the url you pasted is that the name and id attributes can only start with letters. Every generated aspx page contains following html elements: <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /> <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /> Does this mean that every generated aspx page is invalid? If so, then I would putting 'fixing' this in Anthem on the bottom of the priority list. If I'm wrong, then sorry... Brian? Could you pls let me know your comment on this? So I have the same question again. The 2 hidden fields generated by asp are also seen as invalid? Manu. On 3/21/06, Roberto <ro...@lt...> wrote: Hi Guys I was using the latest builds of Anthem.NET, but I suspect the error has been there for a while... It seems u can't validate a page using HTML tidy with Anthem controls since the control names generate ID's such as ID="__Button1__" which I think is not allowed in the spec. Below is an example of the like that gives me a warning in HTML tidy even though it's not an error it would be cool if it could be fixed. Does anyone have a fix for this? <span id="__Button1__"><input type="submit" name ="Button1" value="Start Ajax" onclick="AnthemButton_Click(this,'Button1',true,'Getting info',false,Button1_PreCallBack,Button1_PostCallBack,null,true,true);return false;" id="Button1" /></span><span id="ProgressSection" style="visibility:hidden;" ><img src="images/indicator.gif" border="0" style="vertical-align:middle; padding-left:5px; padding-right:2px;" alt="Progress Icon" />Please wait while retrieving information...</span> line 36 column 9 - Warning: <span> ID "__Button1__" uses XML ID synta Regards Rob No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.2.6/286 - Release Date: 20/03/2006 |