About the author

Imran Imran
Like Development in DotNet.

E-mail me Send mail
Search Entire Web

Recent Articles

 
1: Nokia E72 Firmware version 31.023
Category: ASP.Net
Added: 9/1/2010

 
2: Master Pages
Category: ASP.Net
Added: 1/31/2008

 
3: Caching with ASP.NET
Category: ASP.Net
Added: 1/31/2008

 
4: Free Microsoft Press E-Book Offer!
Category: ASP.Net
Added: 1/30/2008

 
5: Timer Control in Asp.Net
Category: ASP.Net
Added: 1/29/2008

 
6: Checkbox selection with ajax
Category: ASP.Net
Added: 1/29/2008

 
7: UrlRewriter with asp.net
Category: ASP.Net
Added: 1/19/2008

 
8: Auto complete textbox with Ajax
Category: ASP.Net
Added: 1/15/2008

 
9: Upload file with Asp.Net
Category: ASP.Net
Added: 1/15/2008

 
10: User Rating Technique
Category: ASP.Net
Added: 1/8/2008

Master Pages

by Imran 31/January/2008

ASP.NET master pages allow you to create a consistent layout for the pages in your application. A single master page defines the look and feel and standard behavior that you want for all of the pages (or a group of pages) in your application. You can then create individual content pages that contain the content you want to display. When users request the content pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page.

Admin.master

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Admin.master.cs" Inherits="Adminpages_Admin" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<title></title>

<link rel="Stylesheet" type="text/css" href="../Mystyle.css" /> </head>

<body>

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

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

</asp:ContentPlaceHolder>

</form> </body>

</html>

Index.aspx

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

CodeFile="Index.aspx.cs" Inherits="Adminpages_Index"

MasterPageFile="~/Adminpages/Admin.master"

%>

<asp:Content runat="server" ID="Content1" ContentPlaceHolderID="Body">

<table width="100%" align=center >

<tr>

<td align="center" style="color:Silver">

Hello Welcome

</td>

</tr>

</table>

</asp:Content>

Master Pages breaks Menu control

When you want to use menus with Master Pages then you should delete following code from web.config file

<xhtmlConformance mode="Legacy"/>





Powered by DotNetClassic.com