I am getting “Micorsoft Jscript runtime error: Object required” error when I try to refer the .js file that refer a Radcontrol. ie.,"document.getElementById('<%=txtTime.ClientID%>')." Please let me know where i am going wrong. Any help is appreciated.
I originally have the following JavaScript function in the content page and worked just fine. Now I am trying to move my java script to .js file.
I have the RadScriptManager on the master page. I do not want to load the .js code at the master page, so I added a ScriptManagerProxy in my content page as below.
<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
<Scripts>
<asp:ScriptReference Path="../JavaScript/test.js" />
</Scripts>
</asp:ScriptManagerProxy>
Sample Content of my test.js file
function getTime(sender, args){
var strTime =document.getElementById('<%=txtTime.ClientID%>').value;
args.IsValid = true;
}
Thanks in advance.