Vb . net button action does not work

Asked

Viewed 99 times

1

I want to do a simple action when a button is clicked but nothing happens.

Aspx file

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderNormal" runat="server">
    <asp:Button Text="text" runat="server" ID="Teste" />
</asp:Content>

aspx.Vb file

Private Sub Teste_Click(sender As Object, e As EventArgs) Handles Teste.Click
        Teste.Text = "asdasd"
End Sub

In this case nothing happens when the button is clicked. If I place an onclick event on the button this error happens: inserir a descrição da imagem aqui

  • is not missing the button OnClick="Teste_Click"?

  • 1

    Da um erro= 'Teste_click' is not a Member of "web_administrator_configuracoes_usuario_cadastrosetor.aspx"

  • Strange, are you sure that button is on "aspx file."? Another page error is appearing, "aspx."

  • 1

    Unfortunately yes, in fact the code is from the registration screen.aspx I have no idea what it might be since the other buttons of the system work normally.

  • "Unfortunately yes, in fact the code is from the registration screen.aspx" did not understand well, got confused it. On the very page where is the button, in the file .aspx open a tag <script runat="server"> and inside copy the method Private Sub Teste_Click and see if it works

  • 1

    I did it that way and it worked, do you have any idea why? Oh thank you so much for your help

  • Try to "Rebuild Web Site" the application...

  • Where is this option?

  • Go to Visual Studio, open your project, click on the Build menu => Rebuild Web Site.

Show 4 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.