PageRequestManagerParserErrorException

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sweatha
    New Member
    • Mar 2008
    • 44

    PageRequestManagerParserErrorException

    Hi

    I have created the login form with the following coding

    Protected Sub imgLogin_Click( ByVal sender As Object, ByVal e As System.Web.UI.I mageClickEventA rgs) Handles imgLogin.Click

    Dim con As SqlConnection
    Dim cmd As New SqlCommand
    Dim str As String
    Dim rd As SqlDataReader
    str = "user id=sa;password= cast;database=j sc;server=AUROR A-SERVER"
    con = New SqlConnection(s tr)
    Try
    con.Open()
    cmd.CommandType = CommandType.Sto redProcedure
    cmd.CommandText = "Pro_Login1 "
    cmd.Connection = con

    Dim loginid As New SqlParameter("@ loginid", SqlDbType.VarCh ar, 50)
    loginid.Value = txtLoginId.Text .ToString()

    Dim password As New SqlParameter("@ password", SqlDbType.VarCh ar, 50)
    password.Value = txtPassword.Tex t.ToString()

    cmd.Parameters. Add(loginid)
    cmd.Parameters. Add(password)
    Dim cnt As Int16
    cnt = cmd.ExecuteNonQ uery()

    cnt = cmd.ExecuteScal ar()
    If cnt <= 0 Then
    Response.Write( "The login or password you entered does not match our records. Please check your entry and try again.")
    Else
    'Response.Write ("Authorise user")
    Response.Redire ct("Default3.as px")
    End If
    Catch ex As Exception
    End Try
    End Sub


    In this to control the page load, I have kept the "txtPasswor d"- TextBox in Update panel and added the trigger property of the update panel as "imgLogin"-button.

    The issue is, while I am running, if I give the invalid login id or password, The Response.write is not getting displayed instead it is showing the error as


    Sys.WebForms.Pa geRequestManage rParserError Exception: The message received from the server could not be parsed. Common Causes for this error are when the response is modified by calls to Response.Write( ), response filters, Http Modules, or Server trace is enabled.

    Details: Error Pursing near "The login or Password".
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Try taking the if cnt <= 0 out of try catch and closing your connection. Report back what happens. Thanks.

    Comment

    Working...