Can't get property from user control

wsyeager

Centurion
Joined
Apr 10, 2003
Messages
140
Location
Weston, FL
I have a public property inside my usercontrol which I set inside the Repeater.ItemDataBound event as follows:
<code>
If blnFirstTime Then
Dim lblstrDate As Label = DirectCast(e.Item.FindControl("lblPressReleaseDate"), Label)
blnFirstTime = False
strDate = lblstrDate.Text
End If
</code>

After the user control finishes databinding, I want to take the value of this property and display it on the aspx page that is hosting the usercontrol.

I have the following set up:
<code>
Protected PressRoomArticles As New Platform_CampusInfo_PressRoom_UserControls_PressRoomArticles
</code>

I have the following code set up to retrieve the value, but I don't know what event of the page to place it in.
<code>
lblPressDate.Text = PressRoomArticles.sPressReleaseDate 'this is my public property inside the user control
</code>

What event can I use to display the value of this variable?

fyi, this value is coming up as a label text value inside the user control when displayed. Since it's a repeater, I set the visibility to disabled, since I only want it displayed once on the aspx page that hosts this user control.
 
Can't get a property from a user control

The Repeater control is inside the UserControl. My aspx page hosts the UserControl.

I tried setting a break point in the PageLoad event of the aspx page (which is where I wanted to get my property value), but the PageLoad event of the aspx page was never hit... I don't get it. I thought that the UserControl gets rendered first, then the aspx page which hosts it.

All I want to do is to access a property inside the UserControl from my aspx page....
 
Back
Top