I have a content page which has some dynamic HTML and some static HTML. This dynamic HTML is assigned to a hidden variable in page load.
Content page HTML
<asp:HiddenField id = "hid" runat="server"></asp>
CS of content page
protected void Page_Load(object sender, EventArgs e)
{
hid.Value = node1.InnerText;
}
This content page has master page. Below is its page directive
<%@ Page Title="" Language="C#" MasterPageFile="~/log.Master"
AutoEventWireup="true" CodeBehind="Log.aspx.cs" Inherits="s.Log"
ValidateRequest="false" %>`
Below is snippet of Content page
<%@ Page Title="" Language="C#" MasterPageFile="~/log.Master"
AutoEventWireup="true" CodeBehind="Log.aspx.cs" Inherits="s.Log"
ValidateRequest="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:HiddenField id = "hid" runat="server"/>
</asp:Content>`
Now when content page loads, static HTML is loaded inside master page, but dynamic contents are rendered outside master page hence shows wrong rendering.