Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
I have a web user control which contains 'AssociatedLableId' property and a label.
XML
<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.
JavaScript
<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
Updated 10-Sep-12 21:32pm
v2

1 solution

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900