.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Articles >> ASP.NET >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Set the cursor position at the end of the text in the textbox

Posted By:Asha.MP       Posted Date: November 23, 2010    Points: 50    Category: ASP.NET    URL: http://www.dotnetspark.com  

This article explain how to set the cursor at the end of the textbox text

This is the code of javascript in the head part of the aspx page

In the aspx page there are two controls one is text box and one more is button


Main concept here is set the focus on the textbox onclick of the button as below in the aspx.vb


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'Assigning the textbox text
        Me.TextBox1.Text = "aaaaaaaaaaaaa ssssssssssssss dddddddddddd ffffffffffffffff gggggggggggggggg hhhhhhhhh"
    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
'SEtting the focus on the textbox
    End Sub


 Subscribe to Articles


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend