Go4Expert (http://www.go4expert.com/)
-   ASP (http://www.go4expert.com/forums/asp/)
-   -   ~~~~ Master Page ASP.net~~~~ (http://www.go4expert.com/forums/master-page-aspnet-t1094/)

hasmukh 31Jul2006 10:01

~~~~ Master Page ASP.net~~~~
i m using asp.net 2.0 and trying to include master page in my project but whenever i save a file with .master extension and include it in my aspx page i get an error message unknown file extension. I m using text editor to build my web page.

Help required !!!

Thanks in Advance


pradeep 31Jul2006 10:45

Re: ~~~~ Master Page ASP.net~~~~
Checkout a working example, and try to figure out what's wrong with your code.

Code: ASP

<%@ master language="C#" %>
   <script runat="server" language="c#">
   <head id="Head1" runat="server">
       <title>Master Page
       <form id="Form1" runat="server">
           <table id="header" style="WIDTH: 100%; HEIGHT: 80px" cellspacing="1" cellpadding="1" border="1">
                   <td width="100%" style="TEXT-ALIGN: center">
                       This is the header from the Master Page
            <table id="leftNav" style="WIDTH: 108px; HEIGHT: 100%" cellspacing="1" cellpadding="1" border="1">
                   <td style="WIDTH: 100px"> Left Navigation
           <table id="mainBody" style="LEFT: 120px; VERTICAL-ALIGN: top; WIDTH: 848px; POSITION: absolute; TOP: 94px; HEIGHT: 100%" border="1">
                   <td width="100%" style="VERTICAL-ALIGN: top">               
                       <asp:contentplaceholder id="middleContent" runat="Server">               

Code: ASP

<%@ page language="C#" master="~/Intro.master" %>
   <script runat="server">
       void Page_Load(object sender, System.EventArgs e)
           lblMessage.Text = "This content is generated from the content page";
   <asp:content id="Content1" contentplaceholderid="middleContent" runat="server">
       <asp:label runat="server" id="lblMessage"

All times are GMT +5.5. The time now is 01:59.