Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

Thanks,

 

Bill Yeager (MCP, BCIP)

Microsoft Certified Professional

Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer

YeagerTech Consulting, Inc.

Posted

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....

Thanks,

 

Bill Yeager (MCP, BCIP)

Microsoft Certified Professional

Brainbench Certified Internet Professional, .Net Programmer, Computer Programmer

YeagerTech Consulting, Inc.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...