Asp.net programming we consider all important topic for knowledge about controls,web Services, JSON, Ajax, database, and interview related Question. In this Asp.net and sql server tutorial blog we give many examples of jquery as like How Play YouTube Video in Your Asp.net Website by URL, How to Play YouTube Videos in Asp.net by using Jquery , Jquery Change div background on mouseover in asp.net , JQuery UI Datepicker (Calendar) etc.

Tuesday, February 21, 2017

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?

No comments:

Post a Comment