ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Retain TextBox focus on AJAX Timer Tick event in ASP.Net<p>In Timer Tick event you can set focus to the TextBox of your choice.</p> <p>There is nothing much which can be done for such case.</p> <pre class="brush: csharp">txtDate.Focus();</pre> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/145625/Retain-TextBox-focus-on-AJAX-Timer-Tick-event-in-ASPNet/https://www.aspforums.net:443/Threads/145625/Retain-TextBox-focus-on-AJAX-Timer-Tick-event-in-ASPNet/Thu, 21 Jun 2018 06:07:09 GMTRetain TextBox focus on AJAX Timer Tick event in ASP.Net<p>sir if i do this then problem is that cursor always comes to start position not there where my text ends that time when timer tick event occure.</p>https://www.aspforums.net:443/Threads/145625/Retain-TextBox-focus-on-AJAX-Timer-Tick-event-in-ASPNet/https://www.aspforums.net:443/Threads/145625/Retain-TextBox-focus-on-AJAX-Timer-Tick-event-in-ASPNet/Thu, 21 Jun 2018 06:12:56 GMTRetain TextBox focus on AJAX Timer Tick event in ASP.Net<p>For that you have to use JavaScript to place cursor at end of text in TextBox.</p> <p><strong><span style="text-decoration: underline;">Javascript</span></strong></p> <pre class="brush: js">&lt;script type=&#34;text/javascript&#34;&gt; function SetFocusAtEnd(txt) { var length = txt.value.length; txt.setSelectionRange(length, length); } &lt;/script&gt;</pre> <p>Call the JavaScript function on <span style="text-decoration: underline;">onfocus</span> event of TextBox.</p>https://www.aspforums.net:443/Threads/145625/Retain-TextBox-focus-on-AJAX-Timer-Tick-event-in-ASPNet/https://www.aspforums.net:443/Threads/145625/Retain-TextBox-focus-on-AJAX-Timer-Tick-event-in-ASPNet/Thu, 21 Jun 2018 06:32:29 GMT