document.getElementById in with Master Pages

Using JavaScript to locate controls in pages that are linked to master pages can be tricky.  This is because the reassigns control IDs dynamically and the names change. A simple solution is to use inline Tags. For Example: Instead for using: document.getElementById(“Label1″) try using: document.getElementById(“<%=Label1.ClientID%>”)

Scroll to top