Click here to Skip to main content
15,912,205 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
i m creating a dynamic control on particular condition...
i m passing the control clientid when embedding with javascript but its not working fine can any help me out here is my code

DropDownList1.Attributes.Add("onChange", "getDropDownListvalue(" + this.DropDownList1.ClientID + "," + this.Label1.ClientID + ")");



function getDropDownListvalue(dropdown,label)
{
    var IndexValue = document.getElementById(dropdown);
    var label= document.getElementById(label);
}
Posted
Updated 25-Feb-11 0:49am
v2
Comments
pankajupadhyay29 25-Feb-11 6:44am    
what exactly you want to do??
Is to put selected index of dropdown to lable..
and what problem you are getting
TanzeelAhmed 25-Feb-11 6:48am    
yes i want to assign it to label

1 solution

Try this:

DropDownList1.Attributes.Add("onChange", "getDropDownListvalue('" + this.DropDownList1.ClientID + "','" + this.Label1.ClientID + "')");
 
Share this answer
 
Comments
Manfred Rudolf Bihy 25-Feb-11 7:30am    
Well spotted, he forgot quoting the javascript string literals. 5+
Proposed as answer!
R. Giskard Reventlov 25-Feb-11 7:58am    
Thanks

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