Action Attribute
<p>I want to send form data to aspx.cs page view below codes.</p>

<p>But this error generated:Object reference not set to an instance of an object.</p>

<p>Please guide me.</p>

<pre><code>    &lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %&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;/head&gt;

&lt;body&gt;

 &lt;form id="form1" runat="server" method="post" action="Default2.aspx"&gt;

&lt;input id="Text1" type="text" value="dgfdh"  runat="server" name="Text1"/&gt;
&lt;/form&gt;
&lt;/body&gt;

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

<hr>

<pre><code> protected void Page_Load(object sender, EventArgs e)
{
    TextBox1.Text = Request.Form["Text1"].ToString();

}
</code></pre>
