wsyeager Posted October 29, 2005 Posted October 29, 2005 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. Quote Thanks, Bill Yeager (MCP, BCIP) Microsoft Certified Professional Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer YeagerTech Consulting, Inc.
wsyeager Posted October 29, 2005 Author Posted October 29, 2005 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.... Quote Thanks, Bill Yeager (MCP, BCIP) Microsoft Certified Professional Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer YeagerTech Consulting, Inc.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.