Hello, Welcome to my blog. If you like feel free to refer others

Tuesday, 7 August 2012

Nested user controls and javascript getElementById

This is the code to find control in WebUserControl which nested in your aspx page.
Suppose the popup.ascx's ID is popupControl and the locations.ascx's ID is locationControl
To find "drpLocationList" which in location.ascx we can use the below mentioned code:

var ddlLocation = document.getElementById('<%=popupControl.FindControl("locationControl").FindControl("drpLocationList").ClientID%>');

No comments:

Post a Comment