In an ASP.NET web forms project that is not quite ready to be upgraded from 2.0 to 4.0 , there is a change that needs to be made to allow modifications to the HTML and BODY tags on the pages without adding runat=server to the tags which results in the 2.0 styled “ugly ids” like “ctrl_100…”
For example, how could we change these using JavaScript, a Response Filter (the regex to find these specific tags would really help on this one), or something else…from:
<html xmlns="//www.w3.org/1999/xhtml">
<body>
To:
<html lang="jp=JP" xmlns="//www.w3.org/1999/xhtml" dir="rtl">
<body dir="rtl">
JavaScript seems like a possibility, but functions from the server-side could would determine the language and direction the page should have.
If you are sure that there are always some attributes you can remove the first whitespace and add it in markup.
I prefer this method to the javascript method because with the latest the search engines can’t know what language or what direction has the html page.