Question

What features are centralized in your web application by master pages? How are master pages implemented...

What features are centralized in your web application by master pages? How are master pages implemented and what tier(s) do they fall into?.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Master Pages :

  • Master pages are used to create template for asp.net web sites or web applications.
  • Based on this template web pages or web forms can be created.
  • Master page having extension as .master.
  • The pages that is designed on master page are called as content page.
  • Master page can not be executed.
  • Master page can be nested this means one master page can be created based on the other master page.
  • To maintain consistent look and feel Common functionality for a web page can be placed in the master page like header , footer , slider and navigation etc.
  • Master page fall in Presentation Layer or User Interface Layer.

Demonstration :

Here a new Asp.net web application is created in C# using visual studio 2017 with name "Demo_MasterPage".This application contains a master page with name "Main.Master" and content page "Main.aspx".Below section gives details about all these files.

Main.Master :(Master Page)

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

<!DOCTYPE html>

<html>
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
<style type="text/css">
.auto-style1 {
text-align: center;
background-color: #00CCFF;
}
footer{
bottom:0;
position:relative;
}
.auto-style2 {
text-align: center;
background-color: #33CCFF;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<header>
<h1 class="auto-style2">MyWorld.com</h1>
</header>

<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
<footer>
<h3 class="auto-style1">&copy;MyWorld.com.All rights are reserved!!.</h3>
</footer>
</form>
</body>
</html>

Main.aspx :(Content Page)

<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="Main.aspx.cs" Inherits="Demo_MasterPage.Main1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:Image ImageUrl="sampleImage.jpg" runat="server" Height="500px" Width="500px" />
</asp:Content>

Output : Run application using F5 and will get the result as shown below

Screen 1 : Main.aspx

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
What features are centralized in your web application by master pages? How are master pages implemented...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT