Add And Use CSS In ASP.NET WebForms Project | ASP.NET Web Forms Tutorials

 <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MasterPage.master.cs" Inherits="MASTER_PAGE_DEMO_PRACTICE.MasterPage" %>


<!DOCTYPE html>


<html>

<head runat="server">

    <title></title>

    <asp:ContentPlaceHolder ID="head" runat="server">

    </asp:ContentPlaceHolder>

    <link href="Css/Style.css" rel="stylesheet" type="text/css"/>

</head>

<body>

    <form id="form1" runat="server">

        <div class="wrapper">

            <div class="header">

                <h1>THIS IS THE HEADER OF MY NEW WEBSITE !!</h1>

                <img src="images/Screenshot (7).png" width="500" height="200"/>

            </div>

            <div class="content">

                <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

                </asp:ContentPlaceHolder>

            </div>

            <div class="footer">

                <h3>All Rights reserved with my website &copy; 2025</h3>

            </div>

        </div>

    </form>

</body>

</html>

Above File is MASTER_PAGE_DEMO_PRACTICE\MasterPage.Master

















<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="MASTER_PAGE_DEMO_PRACTICE.WebForm1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h2>THIS IS MY INDEX PAGE !!</h2>
    <h2><a href="ContactPage.aspx">GO TO CONTACT PAGE</a></h2>
</asp:Content>
Above File is MASTER_PAGE_DEMO_PRACTICE\WebForm1.aspx














<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="ContactPage.aspx.cs" Inherits="MASTER_PAGE_DEMO_PRACTICE.ContactPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h2>THIS IS MY CONTACT PAGE !!</h2>
</asp:Content>
Above File is MASTER_PAGE_DEMO_PRACTICE\ContactPage.aspx












.wrapper {
    border:5px ridge black;
    width:1000px;
    margin:auto;
}
h1,h2,h3{
    text-align:center;
}
Above File is MASTER_PAGE_DEMO_PRACTICE\Css\Style.css




Comments

Popular posts from this blog

Range Validator Control In ASP.NET Web forms | Form Validation | ASP.NET Web forms

Query String In ASP.NET Web Forms | State Management | ASP.NET | Web Forms

Validation Summary Control In ASP.NET Web forms | Form Validation | ASP.NET