So I have a custom asp.net control that has javascript. I want to be able to call ResetTimeout method on the control that is on the custom control from the page that the custom control is on.
Here is an example of what my code looks like
**TestControl.CS**
[CLSCompliant(true)]
[ToolboxData("<{0}:TestControl runat=server></{0}:TestControl >")]
public class TestControl : WebControl, INamingContainer, IScriptControl, ICallbackEventHandler
{
}
**TestControl.JS**
// Timout Handler -- builds or resets the timeouts
ResetTimeout: function () {
this.HideControl();
this.StartTimers();
},
**TestPage.ASPX**
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
<script type="text/javascript">
function test() {
($("#<%=Test.ClientID%>").ResetTimeout());
}
</script>
<cc1:TestControl id="Test" runat="server"> </TestControl>
</asp:Content>
Change this:
($("#<%=Test.ClientID%>").ResetTimeout());to$find("<%= Test.ClientID %>").ResetTimeout();