G
Guest
While creating a shopping cart application I noticed a strange bug which resulted in the Constructor and everything being called twice. I was using Inherited classes ClassShowProducts inherited TemplatePage which inherited System.Web.UI.Page which I thought was the problem so I spent all day recoding everything so that ClassShowProducts was inherited from System.Web.UI.Page. Then I found out that it still happend.
I then quickly narrowed it down to one line of code in Page_Load(
i have a server control <td id="tdMainContent" runat="server"> and in my Page_Load i go
tdMainContent.InnerHtml = render_MainBody(); // returns a massive string
if i go string MainContent = render_MainBody(); it works fine
however the minute I try setting tdMainContent.InnerHtml it borks and basically when Page_Load ends the class constructor is called and goes through everything again, Class Constructor, OnInit, InitializeComponent, Page_Load etc.
The Length of the string is 4927 bytes and is Valid HTML Content.
After doing some tdMainBodyContent.InnerHtml = string('c', randomlenghs);
it does not appear to be "content length" related I am thinking it may be related to complexity of the structure of the HTML. I have checked the HTML and it is W3C Valid and since it is generated by XML/XSLT i know that there will not be any missing/open tags . I am at a loss
I then quickly narrowed it down to one line of code in Page_Load(
i have a server control <td id="tdMainContent" runat="server"> and in my Page_Load i go
tdMainContent.InnerHtml = render_MainBody(); // returns a massive string
if i go string MainContent = render_MainBody(); it works fine
however the minute I try setting tdMainContent.InnerHtml it borks and basically when Page_Load ends the class constructor is called and goes through everything again, Class Constructor, OnInit, InitializeComponent, Page_Load etc.
The Length of the string is 4927 bytes and is Valid HTML Content.
After doing some tdMainBodyContent.InnerHtml = string('c', randomlenghs);
it does not appear to be "content length" related I am thinking it may be related to complexity of the structure of the HTML. I have checked the HTML and it is W3C Valid and since it is generated by XML/XSLT i know that there will not be any missing/open tags . I am at a loss