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.ImageClickEventArgs) 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=jsc;server=AURORA-SERVER"
con = New SqlConnection(str)
Try
con.Open()
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "Pro_Login1"
cmd.Connection = con
Dim loginid As New SqlParameter("@loginid", SqlDbType.VarChar, 50)
loginid.Value = txtLoginId.Text.ToString()
Dim password As New SqlParameter("@password", SqlDbType.VarChar, 50)
password.Value = txtPassword.Text.ToString()
cmd.Parameters.Add(loginid)
cmd.Parameters.Add(password)
Dim cnt As Int16
cnt = cmd.ExecuteNonQuery()
cnt = cmd.ExecuteScalar()
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.Redirect("Default3.aspx")
End If
Catch ex As Exception
End Try
End Sub
In this to control the page load, I have kept the "txtPassword"- 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.PageRequestManagerParserError 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".