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:
is not missing the button
OnClick="Teste_Click"
?– Ricardo Pontual
Da um erro= 'Teste_click' is not a Member of "web_administrator_configuracoes_usuario_cadastrosetor.aspx"
– Murilo Haas
Strange, are you sure that button is on "aspx file."? Another page error is appearing, "aspx."
– Ricardo Pontual
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.
– Murilo Haas
"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 methodPrivate Sub Teste_Click
and see if it works– Ricardo Pontual
I did it that way and it worked, do you have any idea why? Oh thank you so much for your help
– Murilo Haas
Try to "Rebuild Web Site" the application...
– Wellington Araujo
Where is this option?
– Murilo Haas
Go to Visual Studio, open your project, click on the Build menu => Rebuild Web Site.
– Wellington Araujo