Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Note: I think as a programmer not as a human, so use my answer at your will
Posted

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>

Posted
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.
Note: I think as a programmer not as a human, so use my answer at your will

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