kaisersoze Posted February 10, 2004 Posted February 10, 2004 Hi I have a user control and I am placing that user control on an .aspx page. How can I access the Textbox or label on the usercontrol without writing a property that returns the label or textbox. Is there a way like this: dim v1 as string = ctype(me.parent.findcotrol("label1", Label).text I am getting error Quote Note: I think as a programmer not as a human, so use my answer at your will
tate Posted February 10, 2004 Posted February 10, 2004 I'm having a hard time understanding what you are asking. Are you looking for something like this; <script> Dim strTextContent As String strTextContent = txtTextBox.Text lblRepeatText.Text = strTextContent </script> <form runat="server"> <asp:textbox id="txtTextBox" runat="server"/> <asp:label id="lblRepeatText" runat="server"/> </form> Quote
kaisersoze Posted February 10, 2004 Author Posted February 10, 2004 I have usercontrol on an aspx page. The user control has few label controls and data is filled from database during Page_Load event of the .ascx usercontol. I called this user control on an .aspx page. During the Page_load event of the .aspx I am trying to access the label.text and text1.text values. Since the page load first and then the usercontrol I am not able to access the usercontrol variables. Is there a way I can load user control and then proceed with other contols. Quote Note: I think as a programmer not as a human, so use my answer at your will
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.