I have a code,where when user enter values in textbox,on enter-key press,it will move the value to listbox. And when user enter same values (duplicate),it will remove the duplicate value and tell the user on label that duplicate user is detected.
I have this code as in vb as code behind,and its working fine.
But i wan it to be on client side events,where no postback when everytime the enter key is pressed.
Anyone knows how this code to be applied as client side event code?
I m using devexpress components (for the textbox and listbox)
Protected Sub txtSerialNo_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtSerialNo.TextChanged Dim i As Integer Dim ifoundrec As Integer i = 0 ifoundrec = 0 ifoundrec = LstBoxSerialNo.Items.IndexOfText(txtSerialNo.Text) If ifoundrec = -1 Then LstBoxSerialNo.Items.Add(txtSerialNo.Text) lblStatus.Text = "" txtSerialNo.Text = "" txtSerialNo.Focus() lblSNCount.Text = LstBoxSerialNo.Items.Count ElseIf ifoundrec > -1 Then lblStatus.Text = txtSerialNo.Text + " is duplicate " txtSerialNo.Text = "" txtSerialNo.Focus() End If End Sub
This post has been edited by pwtc222: 16 December 2010 - 02:10 AM