Which page is called first in asp.net c#? Web form or Master page?

Which page is called first in asp.net c#? Web form or Master page?


Code that we write on the master page.

Practical Implementation:



<body>
    <form id="form1" runat="server">        
<div>
            <asp:Label ID="Label1" runat="server" Text="Master Page Load"ForeColor="Red"></asp:Label>
            <br />
            <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

            </asp:ContentPlaceHolder>
        </div>
    </form>
</body>
</html>

In the same manner, you add a label control and write its Text property as “Content Page Load” with Red color. 

Code that we write on web form page

Practical Implementation:

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"Runat="Server">
    <asp:Label ID="Label1" runat="server" Text="Content Page Load"ForeColor="Red"></asp:Label>
    <br />
</asp:Content>

Now, the question arises
Which page label control is called first? Is it the Default.aspx or MasterPage.master?

Comments

Popular posts from this blog