Click here to Skip to main content
12,819,248 members (29,574 online)
Rate this:
Please Sign up or sign in to vote.
I have a web user control which contains 'AssociatedLableId' property and a label.
<uc1:UC id="uc1" run="Ser" AssociatedLableId="lblLable" />

and added a Label and a button in aspx page and registered User Control .
Now when I click the button then the text of label control of aspx page assigned to label control of web user control using JS.
I tried following but not right.
<asp:button id ="btn" run="Ser" text="Click" onClientClick="return assignValue();" />
function assignValue()
     document.getElementById('UserControlsAssocitedControlId').value = document.getElementById('aspxPageLableId').value;

AssociatedLableId property is used to get the Id of aspx page's Label control.
I can find the Id of UserControlsAssocitedControlId but how can I find the aspxPageLableId which I assigned in the AssociatedLableId property in JS.
Posted 10-Sep-12 22:27pm
Updated 10-Sep-12 22:32pm

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170308.1 | Last Updated 12 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100