Hi nauna,
Refer below sample code.
HTML
<asp:ScriptManager runat="server" />
<asp:UpdatePanel ID="updpaging" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="btnshowmore" runat="server" Text="Show More" mousehover="stopTheTimer()" />
<asp:Timer ID="timer" runat="server" Interval="1000" OnTick="Timer1_Tick">
</asp:Timer>
<asp:Label ID="lblTime" runat="server" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnshowmore" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
//$(function () {
$("body").on("mouseover", "[id*=btnshowmore]", function () {
stopTheTimer();
});
$("body").on("mouseout", "[id*=btnshowmore]", function () {
startTheTimer();
});
//});
function stopTheTimer() {
var timerValue = $find('<%= timer.ClientID %>');
timerValue._stopTimer();
var wait = timerValue.get_interval();
}
function startTheTimer() {
var timerValue = $find('<%= timer.ClientID %>');
timerValue._startTimer();
var wait = timerValue.get_interval();
}
</script>
Code
C#
protected void Timer1_Tick(object sender, EventArgs e)
{
lblTime.Text = DateTime.Now.ToString();
}
VB.Net
Protected Sub Timer1_Tick(ByVal sender As Object, ByVal e As EventArgs)
lblTime.Text = DateTime.Now.ToString()
End Sub