Y
Yoshitha
In my webform i have 2 textbox
controls and one button control.
in 1st textbox control i'll enter
email id when it lost its focus i've
tocheck whether the entered email id
exist in database or not, if exists
it has to dispay message that email
id already exist
and i want to set focus to that text box.
see the below code
Private Sub txtEmail_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtEmail.TextChanged
Dim i As Byte
Dim cmd As New OleDbCommand
cmd.Connection = MyConn
cmd.CommandText = "Select count(*) from QA_UserType where Email_Id='" &
txtEmail.Text & "'"
i = cmd.ExecuteScalar()
If i <> 0 Then
Response.Write(txtEmail.Text & " already exist")
txtEmail.Text = ""
// how to set focus to this text box. //
End If
End Sub
Private Sub txtEmail_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtEmail.TextChanged
Dim i As Byte
Dim cmd As New OleDbCommand
cmd.Connection = MyConn
cmd.CommandText = "Select count(*) from QA_UserType where Email_Id='" &
txtEmail.Text & "'"
i = cmd.ExecuteScalar()
If i <> 0 Then
Response.Write(txtEmail.Text & " already exist")
txtEmail.Text = ""
End If
End Sub
when am running my application am
getting that message after clicking
on submit button. but what i want is
Hi,
it has to check before clicking on
submit button.
I set postback property of text box to true.
thanx in advance
yoshitha
controls and one button control.
in 1st textbox control i'll enter
email id when it lost its focus i've
tocheck whether the entered email id
exist in database or not, if exists
it has to dispay message that email
id already exist
and i want to set focus to that text box.
see the below code
Private Sub txtEmail_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtEmail.TextChanged
Dim i As Byte
Dim cmd As New OleDbCommand
cmd.Connection = MyConn
cmd.CommandText = "Select count(*) from QA_UserType where Email_Id='" &
txtEmail.Text & "'"
i = cmd.ExecuteScalar()
If i <> 0 Then
Response.Write(txtEmail.Text & " already exist")
txtEmail.Text = ""
// how to set focus to this text box. //
End If
End Sub
Private Sub txtEmail_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtEmail.TextChanged
Dim i As Byte
Dim cmd As New OleDbCommand
cmd.Connection = MyConn
cmd.CommandText = "Select count(*) from QA_UserType where Email_Id='" &
txtEmail.Text & "'"
i = cmd.ExecuteScalar()
If i <> 0 Then
Response.Write(txtEmail.Text & " already exist")
txtEmail.Text = ""
End If
End Sub
when am running my application am
getting that message after clicking
on submit button. but what i want is
Hi,
it has to check before clicking on
submit button.
I set postback property of text box to true.
thanx in advance
yoshitha