Command Button Never Being Hit
<p>I have a breakpoint on my <code>e.CommandName</code> line, but this line is never being hit.  I also tried to add in a catch block that would write to the browswer but I just get an error of "The page can not be displayed" the typical Chrome error thrown when something goes wrong, nothing related to my project.  Below is my code, what is preventing my <code>e.CommandName</code> line from being hit?</p>

<p><strong>C# Page</strong></p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
{
  if (!IsPostBack) { LoadGrid(); }
}

protected void LoadGrid()
{   
    this.datagrid12.Visible = false;
    this.datagrid12.Visible = true;
    _dataSet = SQLQueryToPullInData
    this.datagrid12.DataSource = _dataSet;
    this.datagrid12.DataBind();
}
</code></pre>

<p><strong>Global.Asax</strong></p>

<pre><code>void Application_Error(object sender, EventArgs e)
{ 
  Exception CurrentException = Server.GetLastError();
  Server.ClearError();
if (CurrentException != null)
{
    try
    {
        using (StreamWriter sw = new StreamWriter(Server.MapPath("ErrorLog.txt")))
        {
            sw.WriteLine(CurrentException.ToString());
            sw.Close();
        }
    }
    catch (Exception ex) { }
  }
}
</code></pre>

<p><strong> HTML </strong></p>

<pre><code>&lt;asp:DataGrid runat="server" ID="datagrid12" AutoGenerateColumns="false" ShowFooter="true" OnItemCommand="datagrid12_ItemCommand" &gt;
&lt;Columns&gt;
&lt;asp:TemplateColumn HeaderText="ID" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="40" Visible="true"&gt;
    &lt;ItemTemplate&gt;
        &lt;asp:LinkButton ForeColor="White" ID="btnEdit" runat="server" CausesValidation="True" CommandName="Edit" Text='&lt;%# Eval("uID") %&gt;' CommandArgument='&lt;%# Eval("uID") %&gt;'&gt;
        &lt;/asp:LinkButton&gt;
    &lt;/ItemTemplate&gt;
&lt;/asp:TemplateColumn&gt;
&lt;asp:BoundColumn DataField="uID" HeaderText="uID" Visible="false"&gt;&lt;/asp:BoundColumn&gt;
&lt;asp:BoundColumn DataField="name" HeaderText="Name"&gt;&lt;/asp:BoundColumn&gt;
</code></pre>

<p>
</p>

<p><strong>Error written to file from Global.Asax</strong></p>

<blockquote>
  <p></p>
</blockquote>

<pre><code>System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---&gt; System.Web.HttpException (0x80004005): Maximum request length exceeded.
   at System.Web.HttpRequest.GetEntireRawContent()
   at System.Web.HttpRequest.FillInFormCollection()
   at System.Web.HttpRequest.EnsureForm()
   at System.Web.HttpRequest.get_Form()
   at System.Web.HttpRequest.get_HasForm()
   at System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull)
   at System.Web.UI.Page.DeterminePostBackMode()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.HandleError(Exception e)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
   at System.Web.UI.Page.ProcessRequest()
   at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
   at System.Web.UI.Page.ProcessRequest(HttpContext context)
   at ASP.pages_usersreport_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\cfdef70b\4f768444\App_Web_0tprbakj.1.cs:line 0
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)
</code></pre>

<p><strong>Other Code I have tried</strong>   </p>

<pre><code>protected void datagrid12_ItemCommand(object source, DataGridCommandEventArgs e)
    {
    try
    {
        if (e.CommandName == "Edit")
        {
            LinkButton btn = ((LinkButton)e.Item.FindControl("btnEdit"));
            string uid = btn.CommandArgument;
        }
    }
    catch (Exception exception) { throw exception; }
    }
</code></pre>

<p><strong>EDIT</strong><br><br>
I updated my html to add this</p>

<pre><code>OnClick="LinkButton_Click"
</code></pre>

<p>And added the command event to show this:</p>

<pre><code>protected void LinkButton_Click(Object sender, EventArgs e)
{
  string commandArgument = (sender as LinkButton).CommandArgument;
  string commandName = (sender as LinkButton).CommandName;
  if (commandName == "Edit")
  {
     Response.Redirect("../page2.aspx", false);
  }
}
</code></pre>

<p>But a breakpoint on <code>string commandName</code> is not hit in this instance either.</p>

<p>If I look at the console output for when my page fails to load this is what I see, nothing descriptive to me, but may mean something to another.</p>

<blockquote>
  <p>POST <a href="http://localhost:1234/page2.aspx" rel="nofollow">http://localhost:1234/page2.aspx</a> net::ERR_Connection_Reset</p>
</blockquote>

<p><strong>EDIT About TimeOut</strong><br>
I have my query set to not timeout (or so I think) and I have my <code>MaxHttpCollectionKeys</code> also set to a very high number as to not time-out.  The query runs fine, and displays results as it should.  The issue lies when I press the linkbutton from the grid that displays.</p>

<pre><code>SqlCommand.CommandTimeout = 0;

&lt;add key="aspnet:MaxHttpCollectionKeys" value="20000"/&gt;
</code></pre>

<p><strong>TO FIX</strong><br>
To remedy this I had to add the below 2 lines to my web.config file</p>

<pre><code>&lt;system.web&gt;
  &lt;httpRuntime maxRequestLength="1048576" executionTimeout="3600" /&gt;
&lt;/system.web&gt;

&lt;system.webServer&gt;
  &lt;security&gt;
    &lt;requestFiltering&gt;
        &lt;requestLimits maxAllowedContentLength="1073741824" /&gt;
    &lt;/requestFiltering&gt;
  &lt;/security&gt;
&lt;/system.webServer&gt;
</code></pre>