How to access controls in master page using javascript? The master page consists of a search textbox, on key down event of the control I call a javascript function writtern inline of the master page. I get the value of entered in textbox in that javascript function. I have tried giving document.getElementById("<%=txtSearch.ClientID %>").value as well as document.getElementById("txtSearch").value. Both display error. I have to access the textbox control from within the master page itself!
Access a control in master page using javascript within the master page itself
asp.net
Best Answer
I think some important bits of markup are missing from what you showed in the comment. I tried it, and the following code works. Check it out, maybe you'll see where your problem is; otherwise, please explain where your markup is different.