masterpage with table layout: how to do it?
<p>Update: I found the cause of this error, I cannot create table layout in masterpage why ?</p>

<blockquote>
  <p>Error 1   The name 'txtUsername' does not exist in the current context</p>
</blockquote>

<p>source code:</p>

<pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MasterPage.master" CodeFile="Login.aspx.cs" Inherits="login" %&gt;

&lt;asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"&gt;
&lt;/asp:Content&gt;
&lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"&gt;
    &lt;form id="form1" runat="server"&gt;
    &lt;div&gt;
         Username: &lt;asp:TextBox ID="TextBox1" runat="server" /&gt;&lt;br&gt;
        Password:&lt;asp:TextBox ID="TextBox2" runat="server" /&gt;&lt;br&gt;
        &lt;asp:Button ID="Button2" runat="server" onclick="Button1_Click" Text="Login" /&gt;&lt;br&gt;
        &lt;asp:Label ID="Label1" runat="server" Text="Please login" /&gt;
    &lt;/div&gt;
    &lt;/form&gt;
&lt;/asp:Content&gt;
</code></pre>

<p>Update: supplement source code </p>

<p>this is the code behind</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;


public partial class login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (FormsAuthentication.Authenticate(txtUsername.Text, txtPassword.Text))
        {
            lblStatus.Text = ("Welcome " + txtUsername.Text);
            FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, true);
        }
        else
        {
            lblStatus.Text = "Invalid login!";
        }
    }
}
</code></pre>

<p>this is the masterpage:</p>

<pre><code>&lt;%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
    &lt;title&gt;&lt;/title&gt;
 &lt;style&gt;
  body {
   margin:0;
   padding:0;
  }
&lt;/style&gt;
    &lt;asp:ContentPlaceHolder id="head" runat="server"&gt;
    &lt;/asp:ContentPlaceHolder&gt;
&lt;/head&gt;
&lt;body&gt;


        &lt;asp:Table ID="Table1" width="100%" runat="server"&gt;
            &lt;asp:TableRow ID="TableRow1" runat="server"&gt;
                &lt;asp:TableCell ID="TableCell1" runat="server" BackColor="Blue" ColumnSpan="3"&gt;Header&lt;/asp:TableCell&gt;
            &lt;/asp:TableRow&gt;
            &lt;asp:TableRow ID="TableRow2" runat="server"&gt;
                &lt;asp:TableCell ID="TableCell2" runat="server" Width="160"&gt;
        &lt;asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server"&gt;
        &lt;/asp:ContentPlaceHolder&gt;
                &lt;/asp:TableCell&gt;
                &lt;asp:TableCell ID="TableCell3" runat="server" Width="800" BackColor="Red" &gt;col2&lt;/asp:TableCell&gt;
                &lt;asp:TableCell ID="TableCell4" runat="server" Width="160" ColumnSpan="3"&gt;col3&lt;/asp:TableCell&gt;
            &lt;/asp:TableRow&gt;
            &lt;asp:TableRow ID="TableRow3" runat="server"&gt;

                &lt;asp:TableCell ID="TableCell5" runat="server"&gt;Footer&lt;/asp:TableCell&gt;

            &lt;/asp:TableRow&gt;
        &lt;/asp:Table&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>code behind</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class MasterPage : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}
</code></pre>
