title: ASP.NET Ajax ErrorSys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server
body: <p>I created an Ajax website in Visual Studio, added a simple page with a textbox and button, when I click the button once everything works, when I click it twice I get the error</p>
  
  <p>Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server.  The status code returned from the server was: 500</p>
  
  <p>Here is my page</p>
  
  <pre><code>&lt;form id="form1" runat="server"&gt;
      &lt;asp:ScriptManager ID="ScriptManager1" runat="server" /&gt;
      &lt;div&gt;
          &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
              &lt;ContentTemplate&gt;
                  &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt;
                  &lt;asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /&gt;
              &lt;/ContentTemplate&gt;
          &lt;/asp:UpdatePanel&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <pre>
  
          Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
          TextBox1.Text = "aaa"
      End Sub
  
  </pre>
  
  <p>Edit ~ I added a second button to the page, outside of the update panel and when I clicked the one inside the update panel and then the one outside of the panel I got the error</p>
  
  <p>Cannot open database "ASPState" requested by the login. The login failed.
  Login failed for user 'server\user'. 
  Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p>
  
  <p>Exception Details: System.Data.SqlClient.SqlException: Cannot open database "ASPState" requested by the login. The login failed.
  Login failed for user 'server\user'.</p>
  
  <p>Why is this?</p>
  
  <p>Edit ~ To resolve my issue I did</p>
  
  <pre><code>&lt;sessionState mode="StateServer"
  stateConnectionString="tcpip=localhost:42424"
  cookieless="false"
  timeout="20"/&gt;
  </code></pre>