2

So I wanted to make my textbox in asp.net to postback every time a text it typed onto it but i cant seem to figure out how. Does any one knows? here is the code of the event handler

Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtFiltrarNomeUtente.TextChanged
    If chkFiltroUtente.Checked And Me.cbxLocal.Text <> "" Then
        Me.loadFormInfo()
    End If
End Sub

and the textbox

<asp:TextBox ID="txtFiltrarNomeUtente" runat="server" AutoPostBack="true">

so any ideas on how to do it? thanks

VDWWD
  • 35,079
  • 22
  • 62
  • 79
Hala mahala
  • 151
  • 2
  • 4
  • 20

1 Answers1

3

You need to add the OnTextChanged event to TextBox txtFiltrarNomeUtente.

<asp:TextBox ID="txtFiltrarNomeUtente" runat="server" AutoPostBack="true" OnTextChanged="TextBox2_TextChanged"></asp:TextBox>
VDWWD
  • 35,079
  • 22
  • 62
  • 79
  • hi again, so i tried adding that but now i got an error saying :BC30456: 'TextBox2_TextChanged' is not a member of 'webforms_frmagendamr_aspx'. – Hala mahala Mar 14 '17 at 17:40
  • See this post. I can happen if there is a mismatch between designer files and aspx page. Usually happens when copying or renaming pages etc. See http://stackoverflow.com/questions/11147100/error-bc30456-method-is-not-a-member-of-asp-codebehind-aspx or https://forums.asp.net/t/1000979.aspx?BC30456+Theme+is+not+a+member+of+ASP+default_aspx+ – VDWWD Mar 14 '17 at 17:46