title: best way to set multiple html attribute without making a usercontrol or using literal control?
body: <p>Trying to find the best way to dynamically add a direction attribute to each of these html elements. I know how to obtain the direction with </p>
  
  <pre><code>var dir = CultureInfo.CurrentCulture.TextInfo.IsRightToLeft ? "rtl" : "ltr";
  </code></pre>
  
  <p>but I need to find a graceful way to dynamically add it to the following html</p>
  
  <pre><code>&lt;!--[if lt IE 7]&gt;&lt;html class="ie6" lang="en"&gt;&lt;![endif]--&gt;;
  &lt;!--[if IE 7]&gt;&lt;html class="ie7" lang="en"&gt;&lt;![endif]--&gt;
  &lt;!--[if IE 8]&gt;&lt;html class="ie8" lang="en"&gt;&lt;![endif]--&gt;
  &lt;!--[if gt IE 8]&gt;&lt;!--&gt;&lt;html lang="en"&gt;&lt;!--&lt;![endif]--&gt;
  </code></pre>
  
  <p>If I put this into a User Control and assign each html element an id, then set each control's direction attribute, I get runtime errors for not having a closing html tag in the user control.</p>
  
  <p>Is there any simple way for me to set the <code>dir</code> attribute for each of these html elements without doing it through a user control? I'm not even able to place a <code>&lt;asp:Literal&gt;</code> control within each html tag, and it is beginning to frustrate me. Thanks</p>
  
  <p>edit: the end result should be</p>
  
  <pre><code>&lt;!--[if lt IE 7]&gt;&lt;html class="ie6" lang="en" dir="ltr"&gt;&lt;![endif]--&gt;;
  &lt;!--[if IE 7]&gt;&lt;html class="ie7" lang="en" dir="ltr"&gt;&lt;![endif]--&gt;
  &lt;!--[if IE 8]&gt;&lt;html class="ie8" lang="en" dir="ltr"&gt;&lt;![endif]--&gt;
  &lt;!--[if gt IE 8]&gt;&lt;!--&gt;&lt;html lang="en" dir="ltr"&gt;&lt;!--&lt;![endif]--&gt;
  </code></pre>