Go4Expert

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


:) HASMUKH :)

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#">
//MASTER FILE
   </script>
   
   <html>
   <head id="Head1" runat="server">
       <title>Master Page
   </head>
   <body>
       <form id="Form1" runat="server">
           <table id="header" style="WIDTH: 100%; HEIGHT: 80px" cellspacing="1" cellpadding="1" border="1">
               <tr>
                   <td width="100%" style="TEXT-ALIGN: center">
                       This is the header from the Master Page
                   </td>
               </tr>
           </table>
           <b/>
            <table id="leftNav" style="WIDTH: 108px; HEIGHT: 100%" cellspacing="1" cellpadding="1" border="1">
               <tr>
                   <td style="WIDTH: 100px"> Left Navigation
                   </td>
               </tr>
               </table>                                 
           <table id="mainBody" style="LEFT: 120px; VERTICAL-ALIGN: top; WIDTH: 848px; POSITION: absolute; TOP: 94px; HEIGHT: 100%" border="1">
               <tr>
                   <td width="100%" style="VERTICAL-ALIGN: top">               
                       <asp:contentplaceholder id="middleContent" runat="Server">               
                   </td>
               </tr>
           </table>
       </form>
   </body>
   </html>


Code: ASP

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



All times are GMT +5.5. The time now is 20:44.