Hi all,
I'm designing a web page in ASPX. I have a few textboxes where the user enters the number of items, and a label that shows what they would currently pay if they checked out at that moment. I need help using a UpdatePanel to refresh the label when they make a change. I have a custom function called Calc() that calulates and returns the amount they owe.. So, for example, when the user changes the text in textbox8, I want the label to be updated with the new value of calc(). Heres my code for the updatepanel/label:
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Font-Bold="True" Font-Size="20pt"
style="text-align: center" Text="You owe: $0.00"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
Then, in my Textbox8.TextChanged method:
Private Sub TextBox8_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox8.TextChanged
Me.Label1.Text = "You owe: " & Calc()
Me.UpdatePanel1.Update()
End Sub
But that doesnt refresh the label. What am I doing wrong?