Newlines should not automatically be added to TITLE taghttp://forums.asp.net/t/1369532.aspx/1?Newlines+should+not+automatically+be+added+to+TITLE+tagMon, 19 Jan 2009 04:44:55 -050013695322857362http://forums.asp.net/p/1369532/2857362.aspx/1?Newlines+should+not+automatically+be+added+to+TITLE+tagNewlines should not automatically be added to TITLE tag <p>If you set page title in a codebehind: </p> <p>page.Title = <span class="st">&quot;My title&quot;</span>;</p> &nbsp;<br> the rendered html is:<br> &lt;title&gt;<br> &nbsp;&nbsp;&nbsp; My title<br> &lt;/title&gt; <p>when it should be</p> <p>&lt;title&gt;My title&lt;/title&gt; </p> <p>This is less than ideal for some SEO optimization.&nbsp; On a large scale, though, it's an example of ASP&nbsp;taking full control of our HTML away from us.&nbsp; A language should not be making this kind of decision.</p> <p>There was a connect issue opened about this:&nbsp; <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=282655"> https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=282655</a></p> <p>Their answer in the connect issue is dancing around the issue--at least give us a way to control whether or not the newlines are added, and leave them by default.&nbsp; Or when 3.5 came out this could have been fixed then.</p> <p>Maybe I'm missing a larger design concept here?</p> <p>Thanks,</p> 2009-01-09T16:31:11-05:002857947http://forums.asp.net/p/1369532/2857947.aspx/1?Re+Newlines+should+not+automatically+be+added+to+TITLE+tagRe: Newlines should not automatically be added to TITLE tag <p>White space doesn't matter in html or xml.&nbsp; spaces are &amp;nbsp;&nbsp; You're talking about two line carrige return line feeds.&nbsp; &nbsp;Good luck with getting the html to not prettyprint on every browser in the world and making it work on world wide scale.</p> <p>&nbsp;</p> 2009-01-09T22:01:44-05:002862528http://forums.asp.net/p/1369532/2862528.aspx/1?Re+Newlines+should+not+automatically+be+added+to+TITLE+tagRe: Newlines should not automatically be added to TITLE tag <p>You didn't read my post fully--newlines in titles can affect SEO optimization, or so&nbsp;several SEO marketing firms have said.&nbsp; I understand whitespace in HTML and realize the page still loads.</p> 2009-01-12T15:41:01-05:002875586http://forums.asp.net/p/1369532/2875586.aspx/1?Re+Newlines+should+not+automatically+be+added+to+TITLE+tagRe: Newlines should not automatically be added to TITLE tag <p>I can sell you some SEO snake oil too.&nbsp;&nbsp;Good Luck</p> <p>&nbsp;</p> 2009-01-19T04:44:55-05:00