Need a solution for run Page_Load and visibility of User controls

A

Andreas Klemt

Hello,

I have an ASPX Page with 8 Web User Controls on it.
Some are Visible = False and some are Visible = True

Now I wrote in each Web User Control code:

Sub Page_Load()
If Me.Visible Then
Me.lblName = "Hello World"
'...Fill all my labels
End If
End Sub

Now I am looking for a better solution because I do this
in my ASPX Code

If something = true then
Control3.Visible = True
End If

Now my Page gets rendered without filling my labels in control3 because
Page_Load is fired before.
What is the solution for this? Should I use in my Web User Controls
Page_PreRender or
is there a better solution for handling Page_Loads and the Visibilty of
controls.

Thanks for any help in advance!!
Andreas
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top