0% found this document useful (0 votes)
4 views

Yug PR of Aspnet 3

Uploaded by

jatinnparmar52
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Yug PR of Aspnet 3

Uploaded by

jatinnparmar52
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 5

ITM(SLS) BARODA UNIVERSITY

DEPARTMENT OF COMPUTER SCIENCE, ENGINEERING AND TECHNOLOGY


Diploma Sem – 5(A)

ASP.Net
PRACTICAL:- 3
Aim:- Create Home page of your website using master page concept.

Theory:- Master pages are used to create consistency from page to page in a document.
Master pages typically contain page headers, footers, margin and column guides, and
other elements that occur on multiple pages in your document.

 One of the key components to a successful Web site is a consistent look and feel.
In ASP.NET 1.x, developers used user controls to replicate common page elements
across a Web application is Master Page.

default.css Code:-
body {
margin: 0px;
font-family: Arial, Helvetica, sans-serif;
background-color: lightgrey;
}
main {
padding: 10px;
}
nav {
background-color: #808080;
padding: 5px;
}
ul {
list-style-type: none;
}
li a {
color: #F1FAEE;
font-size: 30px;
column-width: 10px;
}
li {
display: inline;
padding-left: 2px;
column-width: 20px;
}
a {
text-decoration: none;
margin-left: 20px
}
li a:hover {
background-color: #F3FFBD;
color: #FF1654;
}
footer {
background-color: #808080;
text-align: center;
color: white;
position: fixed;
bottom: 0px;
width: 100%;
padding: 20px;
margin: 5px auto 0 auto;
}

Name:- YUG PANCHAL Enrollment No:- 22C11066 1


ITM(SLS) BARODA UNIVERSITY
DEPARTMENT OF COMPUTER SCIENCE, ENGINEERING AND TECHNOLOGY
Diploma Sem – 5(A)

ASP.Net
MainSite Code:-

<%@ Master Language="C#" AutoEventWireup="true"


CodeBehind="MainSite.master.cs"
Inherits="MasterPageDemo1.MainSite" %> <!DOCTYPE
html>

<html>
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head"
runat="server">
</asp:ContentPlaceHolder>
<link href="Styles/default.css"
rel="stylesheet" />
</head>
<body>
<form id="form1" runat="server">
<div>
<nav>
<ul>
<li><a
href="Default.aspx">Home</a></li>
<li><a
href="About.aspx">About</a></li>
<li><a
href="Contact.aspx">Contact</a></li>
</ul>
</nav>
<asp:ContentPlaceHolder
ID="ContentPlaceHolderMain" runat="server">
</asp:ContentPlaceHolder>
</div>
<footer>
<p>&copy; 2024 Master Site @</p>
</footer>
</form>
</body>
</html>

Name:- YUG PANCHAL Enrollment No:- 22C11066 2


ITM(SLS) BARODA UNIVERSITY
DEPARTMENT OF COMPUTER SCIENCE, ENGINEERING AND TECHNOLOGY
Diploma Sem – 5(A)

ASP.Net
Default.aspx Code:-
<%@ Page Title="" Language="C#"
MasterPageFile="~/MainSite.Master"
AutoEventWireup="true" CodeBehind="Default.aspx.cs"
Inherits="MasterPageDemo1.Default" %>

<asp:Content ID="Content3"
ContentPlaceHolderID="ContentPlaceHolderMain"
runat="server">
<main>
<h1>Welcome to my Main Site.</h1>
</main>

</asp:Content>

Contact.aspx Code:-

<%@ Page Title="" Language="C#"


MasterPageFile="~/MainSite.Master" AutoEventWireup="true"
CodeBehind="Contact.aspx.cs"
Inherits="MasterPageDemo1.Contact" %>

<asp:Content ID="Content3" ContentPlaceHolderID="head"


runat="server">
</asp:Content>
<asp:Content ID="Content4"
ContentPlaceHolderID="ContentPlaceHolderMain"
runat="server">
<main>
<h1>Contact us: [email protected]</h1>
</main>
</asp:Content>

Name:- YUG PANCHAL Enrollment No:- 22C11066 3


ITM(SLS) BARODA UNIVERSITY
DEPARTMENT OF COMPUTER SCIENCE, ENGINEERING AND TECHNOLOGY
Diploma Sem – 5(A)

ASP.Net
About.aspx Code:-

<%@ Page Title="" Language="C#"


MasterPageFile="~/MainSite.Master" AutoEventWireup="true"
CodeBehind="About.aspx.cs"
Inherits="MasterPageDemo1.About" %>

<asp:Content ID="Content3" ContentPlaceHolderID="head"


runat="server">
</asp:Content>
<asp:Content ID="Content4"
ContentPlaceHolderID="ContentPlaceHolderMain"
runat="server">
<main>
<h1>About me: Hello my name is Yug . J . Panchal</h1> </main>

</asp:Content>

Output:-
Header (Home) Section:-

Name:- YUG PANCHAL Enrollment No:- 22C11066 4


ITM(SLS) BARODA UNIVERSITY
DEPARTMENT OF COMPUTER SCIENCE, ENGINEERING AND TECHNOLOGY
Diploma Sem – 5(A)

ASP.Net
Header (Contact) Section:-

Header (About) Section:-

Conclusion:- In this Practical we have learn to make an header and footer section of a
website with the help of Master Page in Visual Studio Community.

Name:- YUG PANCHAL Enrollment No:- 22C11066 5

You might also like