title: Webpage with a Dynamic Header
body: <p>I have a webpage with a dynamic list. I want the headers to be configurable. To start with the headers are named as <code>column1</code>, <code>column2</code>, ... <code>columnnN</code>. Clicking on any of these header I open up a DHTML modal window where I select the header name from a predefined list so that I can assign this header name to the selected column. So I am returning a unique ID from my modal window to my parent form. Now i want to change the header to the selected header.</p>
  
  <p>My XML:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;ROOT&gt;
      &lt;Header&gt;&lt;Item&gt;Column 1&lt;/Item&gt;&lt;/Header&gt;
      &lt;Header&gt;&lt;Item&gt;Column 2&lt;/Item&gt;&lt;/Header&gt;
  
      &lt;ROW&gt;
          &lt;COlUMN&gt;Zamora&lt;/COlUMN&gt;
          &lt;COlUMN&gt; Ruby E.&lt;/COlUMN&gt;
      &lt;/ROW&gt;
      &lt;ROW&gt;
          &lt;COlUMN&gt;Hatfield&lt;/COlUMN&gt;
          &lt;COlUMN&gt; Hanae B.&lt;/COlUMN&gt;
      &lt;/ROW&gt;
  &lt;/ROOT&gt;
  </code></pre>
  
  <p>Here is how I am generating the XML in the code-behind:</p>
  
  <pre class="lang-javascript prettyprint-override"><code>oXMLString.Append(Chr(13) &amp; "&lt;Header&gt;")
  oXMLString.Append(Chr(13) &amp; "&lt;Item&gt;Column " &amp; j + 1 &amp; "&lt;/Item&gt;")
  oXMLString.Append(Chr(13) &amp; "&lt;/Header&gt;")
  </code></pre>
  
  <p>Here is my xslt for the header:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;tr class="thead"&gt;
      &lt;xsl:for-each select="Header/Item"&gt;        
          &lt;td class="rowHead" style="vertical-align:bottom;"&gt;
              &lt;a href="#"&gt;
                  &lt;xsl:attribute name="id"&gt;
                      &lt;xsl:value-of select="@id"/&gt;
                  &lt;/xsl:attribute&gt;
                  &lt;xsl:attribute name="onclick"&gt;
                      &lt;xsl:text&gt;showPopWin('UploadFile_Step4_Modal.aspx',500,500,returnFieldID);&lt;/xsl:text&gt;
                  &lt;/xsl:attribute&gt;
                  &lt;xsl:value-of select="." /&gt;
              &lt;/a&gt;
          &lt;/td&gt;
      &lt;/xsl:for-each&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>When the list is generated the column headers are <code>column1</code> and <code>column2</code> where n=2</p>
  
  <p>In the xslt the <code>onclick</code> event open a modal window which returns a <code>fieldID</code> for the column header.</p>
  
  <p>Now suppose i click on <code>column1</code> and the modal window returns <code>fieldid="1"</code> which is predefined in the database, how do i change the column header from
  <code>column1</code> to <code>Firstname</code> (<code>Fieldid=1</code> is <code>Firstname</code>)</p>