<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Web Forms</title><link>http://forums.asp.net/18.aspx</link><description>All about building ASP.NET Pages - server controls, events, validation, etc.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: dropdownlist breaks xhtml validation</title><link>http://forums.asp.net/thread/1571999.aspx</link><pubDate>Fri, 09 Feb 2007 17:37:25 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1571999</guid><dc:creator>Rossoneri</dc:creator><author>Rossoneri</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1571999.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1571999</wfw:commentRss><description>Glad it worked for you. Don't forget to mark the post that answered your question.&lt;br /&gt;&lt;br /&gt;Valencia is my second favorite team! I hope they embarrass Inter &lt;img src="http://forums.asp.net/emoticons/emotion-2.gif" alt="Big Smile" /&gt;&lt;br /&gt;</description></item><item><title>Re: dropdownlist breaks xhtml validation</title><link>http://forums.asp.net/thread/1571981.aspx</link><pubDate>Fri, 09 Feb 2007 17:25:05 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1571981</guid><dc:creator>elwise</dc:creator><author>elwise</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1571981.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1571981</wfw:commentRss><description>&lt;p&gt;Thanks man, that worked perfectly!&lt;/p&gt;&lt;p&gt;now let's hope valencia beats inter next week in the champions league!&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: dropdownlist breaks xhtml validation</title><link>http://forums.asp.net/thread/1571899.aspx</link><pubDate>Fri, 09 Feb 2007 16:43:04 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1571899</guid><dc:creator>Rossoneri</dc:creator><author>Rossoneri</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1571899.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1571899</wfw:commentRss><description>To answer your question... you do not have to pass it an HtmlTextWriter. .NET does that internally.&lt;br /&gt;</description></item><item><title>Re: dropdownlist breaks xhtml validation</title><link>http://forums.asp.net/thread/1571890.aspx</link><pubDate>Fri, 09 Feb 2007 16:39:36 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1571890</guid><dc:creator>Rossoneri</dc:creator><author>Rossoneri</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1571890.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1571890</wfw:commentRss><description>&lt;p&gt;You create a new class, call it XHtmlPage for example You set it up like&lt;br /&gt;&lt;br /&gt;public class XHtmlPage : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Paste the Render function above in here... public override void Render&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // You can rename the variables as you wish - Reflector gives them generic names as you see above&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;That's it. You will have to add some namespaces to the top of this class or qualify the StringWriter and HtmlTextWriter with their appropriate namespaces&lt;br /&gt;&lt;br /&gt;I also noticed that in the function above, xHtml was declared as a private variable so you can either do that as well or add string xHtml = string.Empty at the top of the Render method&lt;br /&gt;&lt;br /&gt;Then when you setup a Page like Default.aspx, when you view the codebehind you see the class has&lt;br /&gt;&lt;/p&gt;&lt;p&gt;_Default : System.Web.UI.Page&lt;br /&gt;&lt;br /&gt;You change it to &lt;br /&gt;&lt;br /&gt;_Default : XHtmlPage&lt;br /&gt;&lt;br /&gt;And of course if the class you created has a different namespace, then you will have to bring that it as well with a using statement at the top or qualifying it. Does this make sense?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: dropdownlist breaks xhtml validation</title><link>http://forums.asp.net/thread/1571849.aspx</link><pubDate>Fri, 09 Feb 2007 16:22:59 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1571849</guid><dc:creator>elwise</dc:creator><author>elwise</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1571849.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1571849</wfw:commentRss><description>&lt;p&gt;cool thanks!&lt;/p&gt;&lt;p&gt;so how does it work?&lt;/p&gt;&lt;p&gt;I need to paste this method in my page and then call it from pageload?&lt;/p&gt;&lt;p&gt;also, it also looks like the method is specting&amp;nbsp; HtmlTextWriter ?&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: dropdownlist breaks xhtml validation</title><link>http://forums.asp.net/thread/1571821.aspx</link><pubDate>Fri, 09 Feb 2007 16:05:13 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1571821</guid><dc:creator>Rossoneri</dc:creator><author>Rossoneri</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1571821.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1571821</wfw:commentRss><description>I remember fighting this back in the day. We ended up creating a class that inherited from System.Web.UI.Page, then override the Render Method. Then had our aspx pages inherit from this class&lt;br /&gt;&lt;br /&gt;I don't have the original source for this, but I reflected and here is what was in there&lt;br /&gt;&lt;pre&gt;&lt;font color="#1000a0"&gt;protected&lt;/font&gt; &lt;font color="#1000a0"&gt;override&lt;/font&gt; &lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=1" title="System.Void"&gt;void&lt;/a&gt; &lt;b&gt;Render&lt;/b&gt;(&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=2" title="System.Web.UI.HtmlTextWriter"&gt;HtmlTextWriter&lt;/a&gt; output)&lt;br /&gt;{&lt;br /&gt;      &lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=3" title="System.IO.StringWriter"&gt;StringWriter&lt;/a&gt; &lt;b&gt;writer1&lt;/b&gt; = &lt;font color="#1000a0"&gt;new&lt;/font&gt; &lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=4" title="System.IO.StringWriter.StringWriter();"&gt;StringWriter&lt;/a&gt;();&lt;br /&gt;      &lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=5" title="System.Web.UI.HtmlTextWriter"&gt;HtmlTextWriter&lt;/a&gt; &lt;b&gt;writer2&lt;/b&gt; = &lt;font color="#1000a0"&gt;new&lt;/font&gt; &lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=6" title="System.Web.UI.HtmlTextWriter.HtmlTextWriter(TextWriter);"&gt;HtmlTextWriter&lt;/a&gt;(&lt;a title="StringWriter writer1 // Local Variable"&gt;writer1&lt;/a&gt;);&lt;br /&gt;      &lt;font color="#1000a0"&gt;base&lt;/font&gt;.&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=7" title="void System.Web.UI.Page.Render(HtmlTextWriter);"&gt;Render&lt;/a&gt;(&lt;a title="HtmlTextWriter writer2 // Local Variable"&gt;writer2&lt;/a&gt;);&lt;br /&gt;      &lt;a title="HtmlTextWriter writer2 // Local Variable"&gt;writer2&lt;/a&gt;.&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=8" title="void System.IO.TextWriter.Close();"&gt;Close&lt;/a&gt;();&lt;br /&gt;      &lt;font color="#1000a0"&gt;this&lt;/font&gt;.&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=9" title="string PowerCart.XHtmlPage.xHtml;"&gt;xHtml&lt;/a&gt; = &lt;a title="StringWriter writer1 // Local Variable"&gt;writer1&lt;/a&gt;.&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=10" title="StringBuilder System.IO.StringWriter.GetStringBuilder();"&gt;GetStringBuilder&lt;/a&gt;().&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=11" title="string System.Text.StringBuilder.ToString();"&gt;ToString&lt;/a&gt;();&lt;br /&gt;      &lt;font color="#1000a0"&gt;this&lt;/font&gt;.&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=12" title="string PowerCart.XHtmlPage.xHtml;"&gt;xHtml&lt;/a&gt; = &lt;font color="#1000a0"&gt;this&lt;/font&gt;.&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=13" title="string PowerCart.XHtmlPage.xHtml;"&gt;xHtml&lt;/a&gt;.&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=14" title="string System.String.Replace(string, string);"&gt;Replace&lt;/a&gt;(&lt;font color="#800000"&gt;"&amp;lt;script language=\"javascript\"&amp;gt;"&lt;/font&gt;, &lt;font color="#800000"&gt;"&amp;lt;script type=\"text/javascript\"&amp;gt;"&lt;/font&gt;);&lt;br /&gt;      &lt;font color="#1000a0"&gt;this&lt;/font&gt;.&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=15" title="string PowerCart.XHtmlPage.xHtml;"&gt;xHtml&lt;/a&gt; = &lt;font color="#1000a0"&gt;this&lt;/font&gt;.&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=16" title="string PowerCart.XHtmlPage.xHtml;"&gt;xHtml&lt;/a&gt;.&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=17" title="string System.String.Replace(string, string);"&gt;Replace&lt;/a&gt;(&lt;font color="#800000"&gt;"&amp;lt;script language=\"javascript\" type=\"text/javascript\"&amp;gt;"&lt;/font&gt;, &lt;font color="#800000"&gt;"&amp;lt;script type=\"text/javascript\"&amp;gt;"&lt;/font&gt;);&lt;br /&gt;      &lt;font color="#1000a0"&gt;this&lt;/font&gt;.&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=18" title="string PowerCart.XHtmlPage.xHtml;"&gt;xHtml&lt;/a&gt; = &lt;font color="#1000a0"&gt;this&lt;/font&gt;.&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=19" title="string PowerCart.XHtmlPage.xHtml;"&gt;xHtml&lt;/a&gt;.&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=20" title="string System.String.Replace(string, string);"&gt;Replace&lt;/a&gt;(&lt;font color="#800000"&gt;"language=\"javascript\""&lt;/font&gt;, &lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=21" title="System.String"&gt;string&lt;/a&gt;.&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=22" title="string System.String.Empty;"&gt;Empty&lt;/a&gt;);&lt;br /&gt;      &lt;a title="HtmlTextWriter output; // Parameter"&gt;output&lt;/a&gt;.&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=23" title="void System.IO.TextWriter.Write(string);"&gt;Write&lt;/a&gt;(&lt;font color="#1000a0"&gt;this&lt;/font&gt;.&lt;a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Object=24" title="string PowerCart.XHtmlPage.xHtml;"&gt;xHtml&lt;/a&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;</description></item><item><title>Re: dropdownlist breaks xhtml validation</title><link>http://forums.asp.net/thread/1571801.aspx</link><pubDate>Fri, 09 Feb 2007 15:55:02 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1571801</guid><dc:creator>elwise</dc:creator><author>elwise</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1571801.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1571801</wfw:commentRss><description>&lt;p&gt;thanks, that was a good idea.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I tried that, but it only accepts 1 attribute, so I tried:&lt;/p&gt;&lt;p&gt;dropArchive.Attributes.Remove("javascript");&lt;br /&gt;dropArchive.Attributes.Remove("language");&lt;br /&gt;dropArchive.Attributes.Remove("language=\"javascript\"");&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;and even &lt;/p&gt;&lt;p&gt;dropArchive.Attributes.Clear();&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;but it didn't do anything.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;any other ideas?&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: dropdownlist breaks xhtml validation</title><link>http://forums.asp.net/thread/1571769.aspx</link><pubDate>Fri, 09 Feb 2007 15:39:46 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1571769</guid><dc:creator>bpag</dc:creator><author>bpag</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1571769.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1571769</wfw:commentRss><description>&lt;p&gt;If you take off the autopostback='true' then ASP.Net won't add the onchange='..' to the dropdown but it also won't postback when you change the value so you'd then have to add the javascript your self to do the postback, which seems a little odd just to pass xhtml validation.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: dropdownlist breaks xhtml validation</title><link>http://forums.asp.net/thread/1571751.aspx</link><pubDate>Fri, 09 Feb 2007 15:29:27 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1571751</guid><dc:creator>tfsmag</dc:creator><author>tfsmag</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1571751.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1571751</wfw:commentRss><description>&lt;p&gt;have you tried doing something like &lt;/p&gt;&lt;p&gt;droparchive.attributes.remove("language","javascript")&lt;/p&gt;&lt;p&gt;in the page_load or page_init event in your codebehind?&amp;nbsp;&lt;/p&gt;</description></item><item><title>dropdownlist breaks xhtml validation</title><link>http://forums.asp.net/thread/1571711.aspx</link><pubDate>Fri, 09 Feb 2007 15:09:51 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1571711</guid><dc:creator>elwise</dc:creator><author>elwise</author><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1571711.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=18&amp;PostID=1571711</wfw:commentRss><description>&lt;p&gt;Hi,

&lt;/p&gt;&lt;p&gt;I have this dropdownlist that breaks xhtml w3c validation because it
generates a select tag with a javascript property. this only happens
when autopostback is set to true.

&lt;/p&gt;&lt;p&gt;so the the validation error that i get is this:

&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;span class="err_type"&gt;Error&lt;/span&gt;
        &lt;em&gt;Line 263 column 86&lt;/em&gt;:
        &lt;span class="msg"&gt;there is no attribute "language"&lt;/span&gt;.&lt;/i&gt;&lt;/p&gt;&lt;pre&gt;&lt;i&gt;&lt;code class="input"&gt;...PostBack('dropArchive','')" language=&lt;strong&gt;"&lt;/strong&gt;javascript" id="dropArchive"&amp;gt;&lt;/code&gt;&lt;/i&gt;&lt;/pre&gt;&lt;p&gt;

this is the code.

&lt;/p&gt;&lt;p&gt;&lt;b&gt;this control:&lt;/b&gt;



&lt;/p&gt;&lt;p&gt;&lt;i&gt;&amp;nbsp;&amp;lt;asp:dropdownlist id="dropArchive" runat="server" AutoPostBack="True"&amp;gt;&amp;lt;/asp:dropdownlist&amp;gt;&lt;/i&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;generates this html:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&amp;lt;select name="dropArchive" onchange="__doPostBack('dropArchive','')" &lt;br /&gt; language="javascript" id="dropArchive"&amp;gt; &lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;option value="1"&amp;gt;Episode 1&amp;lt;/option&amp;gt; &lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;option value="2"&amp;gt;Episode 2&amp;lt;/option&amp;gt; &lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;option selected="selected" value="3"&amp;gt;Episode 3&amp;lt;/option&amp;gt; &lt;br /&gt; &amp;lt;/select&amp;gt;&amp;nbsp; &lt;/i&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;any idea on how can i stop the dropdownlist to generate the
language="javascript" bit?&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;would the dropdown work without it? (I guess so?)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;Thanks!&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>