Mafullah Backtrack Mafullah Backtrack - 4 months ago 12x
Ajax Question

Timer_Tick is not member an aspx page

I have a Timer control and updatepanel for recheck on some several time. but my problem is why Timer_1 is detected with not a member for my aspx page error message,
Here my code

<asp:UpdatePanel ID="UpdatePanel4" runat="server">
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Timer1_Tick" />
<asp:Timer ID="Timer1" runat="server" OnTick="Timer1_Tick" Interval="60"></asp:Timer>

and here my problem,

enter image description here

Here my code behind :

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
If UUID <> "" Then

If UUID = Cardode Then
scnRFID.Text = CardIdent
Timer1.Enabled = False
Timer1.Enabled = false

End If

End If

End Sub

Thank you in advance


Your problem is that Timer1_Tick is private. Internally .aspx file is represented by a class that inherits from code behind class, so private methods are not visible for it.

Make it protected and everything should work fine