Sys.WebForms.PageRequestManagerServerErrorException On post back
<p>I am working on asp.net 4.0 (web forms) and i am facing the error on login page whenever the page post backs to verify the credentials, it shows the following error. </p>

<blockquote>
  <p>Sys.WebForms.PageRequestManagerServerErrorException: An unknown error
  occurred while processing the quest on the server. The status code
  returned from the server was: 404.</p>
</blockquote>

<p>I want to tell you people the complete scenario. because I am using the server.transer in my handler and using typing the followin url to access the login page.</p>

<p>Here is my .aspx content page which uses master page.</p>

<p>    <br>
        </p>

<pre><code>        &lt;asp:TextBox ID="txtEmail" runat="server" Width="200px" AutoCompleteType="None"&gt;&lt;/asp:TextBox&gt;
        &lt;asp:TextBox ID="txtPassword" runat="server" TextMode="Password" Width="200px" AutoCompleteType="None"&gt;&lt;/asp:TextBox&gt;

       &lt;asp:Button ID="cmdLogin" runat="server" Text="Login" OnClick="cmdLogin_Click" /&gt;

    &lt;/ContentTemplate&gt;
&lt;/asp:UpdatePanel&gt;    
</code></pre>

<p></p>

<p>Here is my handler <code>ProcessRequst</code> Method</p>

<pre><code>    public void ProcessRequest(HttpContext context)
    {   
        string stringRqourl = context.Request.RawUrl;
        tbl_contactcompanies tblCustomer = null;

        try
        {               
            int lastIndex = stringRqourl.ToLower().LastIndexOf("/");
            int lenStart = lastIndex - 1;
            int wordLengeth = stringRqourl.Length - lenStart;
            string customerCodeName = stringRqourl.Substring(1, stringRqourl.Length - wordLengeth);
            tblCustomer = CustomerManager.GetCustomerByWebCode(customerCodeName);
        }
        catch (Exception)
        {
            tblCustomer = null;
        }

        if (tblCustomer == null)
            Redirect404Page(context);
        else
        {
            Dictionary&lt;string, string&gt; paramsdic = new Dictionary&lt;string, string&gt;();
            paramsdic.Add(ParameterName.CUSTOMER_ID, tblCustomer.ContactCompanyID.ToString());
            paramsdic.Add(ParameterName.IS_ALLOW_WEB_ACCESS, tblCustomer.IsAllowWebAccess.ToString());

            //Note it is server.transer which creates the following :
            // "CorpLogin.aspx?IsAllowWebAcces=1&amp;&amp;CustomerID=123"
             HttpContext.Current.Server.Transfer(Utils.BuilQueryString("CorpLogin.aspx", paramsdic));

        }

    }
</code></pre>

<p>Here are the stpes which i follow:</p>

<p>Step 1:
 in url i type <a href="http://localhost/coprprate123/login" rel="nofollow">http://localhost/coprprate123/login</a> and a customer handler listens such request and parse the id for example in my case it is 123. and sever.transfer transfers the requst to the CorpLogin.aspx and url remains the same (that what i want to achieve)</p>

<p>Step 2:</p>

<p>Give some invalid credentials, page post backs by clicking on the login button and the following js error comes out.</p>

<blockquote>
  <p>Sys.WebForms.PageRequestManagerServerErrorException: An unknown error
  occurred while processing the quest on the server. The status code
  returned from the server was: 404.</p>
</blockquote>

<p>This does not happen on post back whenever I do remove the Update Panel. I am stuck with it and searched alot on the internet. Kindly if some can look into the issue</p>

<p>Regards,
Salman.</p>
