0
그래서 JavaScript가있는 사용자 지정 asp.net 컨트롤이 있습니다. 사용자 지정 컨트롤이있는 페이지에서 사용자 지정 컨트롤에있는 컨트롤에 ResetTimeout 메서드를 호출 할 수 싶습니다. 여기 aspx 페이지에서 사용자 정의 컨트롤에 연결되는 Javascript 메서드를 호출하십시오.
내 코드는**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>
$ find()와 $() 사이의 차이점은 무엇입니까? –
$ 찾기는'Sys.Application.findComponent' (MicrosoftAjax 라이브러리의 일부)의 지름길 인 반면 $는 jQuery의 바로 가기입니다. http://blogs.msdn.com/b/irenak/archive/2007/02/19/sysk-290-asp-net-ajax-get-vs-find.aspx –
@MicahArmantrout이 링크도 유용 할 것으로 믿습니다. 당신을 위해 : http://dotnetslackers.com/articles/ajax/ASPNETAJAXControlDevelopment.aspx http://msdn.microsoft.com/en-us/library/bb397536.aspx –