About the author

Imran Imran
Like Development in DotNet.

E-mail me Send mail

Recent Articles

 
1: Roles And Membership
Category: ASP.Net
Added: 6/2/2008

 
2: ListView and DataPager in ASP.NET 3.5
Category: ASP.Net
Added: 5/15/2008

 
3: Asp.Net Cookies
Category: ASP.Net
Added: 5/8/2008

 
4: DatagridDatalistRepeater
Category: ASP.Net
Added: 5/8/2008

 
5: mySql With Asp.Net
Category: Databases
Added: 4/16/2008

 
6: MDF without LDF
Category: Databases
Added: 4/16/2008

 
7: Disable Right Click
Category: Java Script
Added: 4/16/2008

 
8: String Functions
Category: ASP.Net
Added: 3/20/2008

 
9: Water Mark
Category: HTML & DHTML
Added: 3/20/2008

 
10: Ajax With Javascript
Category: AJAX
Added: 3/10/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