Update a user control after Button_Click event

W

Winshent

How do you update a user control after a button click event.

I have a simple shopping basket user control. If a customer updates
their basket, then user control should reflect the number of items and
value of the basket.

My code for the basket control is as follows:

'###################################################
Namespace Web.controls.User

Public Class Header
Inherits System.Web.UI.UserControl

Protected WithEvents lblBasket As System.Web.UI.WebControls.Label

Private Sub Page_Load
SetControls()
End Sub

Public Sub SetControls()
'code to output the basket info to lblBasket
End Sub

End Class

End Namespace
'###################################################

Surely this must be an easy task?

Thanks, Vincent
 
G

Guest

Create the user control as a black box, meaning any events it handles get
bubbled up and all communication to the control is through properties and/or
methods. You can then do something like:

MyControl.Refresh()

Assuming a refresh method is implemented on the control.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top