I want to update the content of a div in code behind:
StringWriter stringWriter = new StringWriter();
HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);
// adding new contents for htmlWriter
// update the div content
divBuilder.InnerHtml = stringWriter.ToString();
THe divBuilder is simply a html div:
<div id="divBuilder" runat="server"></div>
It works fine with IE and Chrome. Event it works well with Firefox in localhost but after uploading the website on the server, I got this error:
cannot get inner content of divBuilder because the contents are not literal
Searching on some sites, I came to this one: http://forums.asp.net/t/1168614.aspx/1
But then how to update the content?
Thanks in advance.
Try the HtmlContainerControl.InnerText property instead since you are using a string for the content.