title: Replace tokens in an aspx page on load
body: <p>I have an aspx page that contains regular html, some uicomponents, and multiple tokens of the form {tokenname} .</p>
  
  <p>When the page loads, I want to parse the page content and replace these tokens with the correct content. The idea is that there will be multiple template pages using the same codebehind.</p>
  
  <p>I've no trouble parsing the string data itself, (see <a href="https://stackoverflow.com/questions/159017/named-string-formatting-in-c" title="named string formatting">named string formatting</a>, <a href="https://stackoverflow.com/questions/20267/best-way-to-replace-tokens-in-a-large-text-template" title="replace tokens">replace tokens in template</a>) my trouble lies in when to read, and how to write the data back to the page...</p>
  
  <p>What's the best way for me to rewrite the page content? I've been using a streamreader, and the replacing the page with Response.Write, but this is no good - a page containing other .net components does not render correctly.</p>
  
  <p>Any suggestions would be greatly appreciated!</p>