Author: imarash | Posted on: 12/11/2009 10:09:18 AM | Views : 312

I have a master page and all my pages inherit it.
I have overridden Render only in the page that I want to render and save as html, the way I am doing it is like this:
    protected override void Render(HtmlTextWriter writer)
    {
     using (StringWriter stringWriter = new StringWriter(new StringBuilder(), CultureInfo.InvariantCulture))
     {
      HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter);

      base.Render(htmlTextWriter);
      File.AppendAllText(MapPath("~\\FileNameBlaBla.html", stringWriter.ToString());
     }
    }
But I get these errors:


             RegisterForEventValidation can only be called during Render();
 

Go to the complete details ...