If it was Windows Forms, I could have used
textbox1.Select(textbox1.Text.Length,0);
How can I achieve this in C#, for an ASP.Net Textbox. I would like to do this only in C#
If it was Windows Forms, I could have used
textbox1.Select(textbox1.Text.Length,0);
How can I achieve this in C#, for an ASP.Net Textbox. I would like to do this only in C#
This one worked for me (works in chrome and IE)
<asp:TextBox ID="txtBranch" runat="server" onfocus="this.value=this.value;">
</asp:TextBox>
Courtesy: Use JavaScript to place cursor at end of text in text input element
If I understand your question correctly, you can call Focus method from code behind.
It basically places a cursor inside TextBox using JavaScript, when the page is loated at client side.
<asp:TextBox runat="server" ID="textbox1"></asp:TextBox>
protected void Page_Load(object sender, EventArgs e)
{
textbox1.Focus();
}