How to modify the HTML and BODY tags in an ASP.NET page without adding runat=server to the elements?
- by jon333
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.