Asp.Net Tutorial and Assignment no 9 for Beginner Create Master Page in Master pages enable to create a perfect and consistent look, behavior for all the web pages in your web application. The content pages contain the content you want to display.

A master webpage provides a template for other web pages, with shared layout design and functionality of master design. The master page defines placeholders for the content, which can be overridden by content pages. The output result is a combination of the master page and the content page.

When users request the content page, ASP.NET merges the pages to produce output that combines the layout of the master page with the content of the content page.


Must Read : How To Spy on Girlfriend / Boyfriend Whatsapp Account

Must Read: Install Whatsapp with Rooted Andriod Phone

Lecture 5

Asp.Net Programming Assignment no 9 – ASP Tutorial for Beginners Create Master Page in



Create a Master page which display current date as soon as form is loaded and provide some link to display another page, apply it to another web page.

Controls, Methods, Properties & Event Used:

  1. Master Page
  2. Label
  3. Hyper Link

Output: Tutorial Create Master Page


Copy and Paste the Code in

// In Master Page Source //
<html xmlns=”” >
<head runat=”server”>
<title>Untitled Page</title>
font-family:verdana; font-size:10pt;
border: 1px solid silver; font-size:8pt; color:grey;
border:1px solid black; background-color:
<body leftmargin=”0″ topmargin=”0″>
<form id=”form1″ runat=”server”>
<table border=”0″ cellpadding=”0″ cellspacing=”0″ style=”width: 750px”>
<td align=”left” colspan=”1″ style=”height:100px; background-color: #ffffff; border-bottom: solid thin black;” valign=”top”>
<asp:Image ID=”Image1″ runat=”server” Height=”80px” ImageUrl=”~/images/4.jpg” Width=”120px” /></td>
<td align=”left” colspan=”2″ style=”height:100px;border-bottom: solid thin black;” valign=”top”>
<br />
<strong><h3>ASP.NET Lecture</h3>
<asp:Label ID=”Label1″ runat=”server”></asp:Label>&nbsp;</p>
<td style=”width: 180px; height: 400px;background-color: #ffffcc;” valign=”top”>
<br />
<asp:HyperLink ID=”HyperLink1″ runat=”server” NavigateUrl=”~/frmDropdownListExample.aspx”>Dropdownlist Example</asp:HyperLink><br />
<asp:HyperLink ID=”HyperLink2″ runat=”server” NavigateUrl=”~/frmCheckBoxExample.aspx”>CheckBox Example</asp:HyperLink><br />
<asp:HyperLink ID=”HyperLink3″ runat=”server” NavigateUrl=”~/frmValidationControlsExample.aspx”>Validation Example</asp:HyperLink><br />
<asp:HyperLink ID=”HyperLink4″ runat=”server” NavigateUrl=”~/Default3.aspx”>Register
User</asp:HyperLink><br />
<asp:HyperLink ID=”HyperLink5″
runat=”server” NavigateUrl=”~/frmMasterPageExample.aspx”>Master page example 1</asp:HyperLink><br />
<asp:HyperLink ID=”HyperLink6″
runat=”server” NavigateUrl=”~/frmMasterpageExample2.aspx”>Master page example 2</asp:HyperLink></td>
<td colspan=”2″ style=”width: 570px; height:400px” valign=”top”>
<div style=”margin-left:25px; margintop:25px;”>
<asp:ContentPlaceHolderID=”ContentPlaceHolder1″ runat=”server”>
<td colspan=”3″ style=”border-top: solid thin
&copy; 2008 ASPLecture</td>

AD [ResponsiveRect]

// In Master Page .cs File //
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class MasterPage : System.Web.UI.MasterPage
protected void Page_Load(object sender, EventArgs e)
Label1.Text = DateTime.Now.ToString(“dd-MMM”);

// In .Aspx Source //
<%@ Page Language=”C#” MasterPageFile=”~/MasterPage.master” AutoEventWireup=”true” CodeFile=”frmMasterPageExample.aspx.cs” Inherits=”frmMasterPageExample” Title=”Untitled Page” %>
<asp:Content ID=”Content1″ ContentPlaceHolderID=”ContentPlaceHolder1″ Runat=”Server”>
<br />
&nbsp;<asp:Image ID=”Image1″ runat=”server” ImageUrl=”~/images/graphic_design.jpg” />

Find More Tutorials Here

Find Tally Tutorial Here
Find Advance Excel Tutorial Here

Leave a Reply

Your email address will not be published. Required fields are marked *