0

I have a TextBox multiline and i need to scroll to specific line in textbox.. Please help me

Page.ClientScript.RegisterStartupScript(this.GetType(), "check", "<script type=\'text/javascript\'>document.getElementById('" + this.textbox.ClientID + "').scrollHeight=100;</script>");
demongolem
  • 9,474
  • 36
  • 90
  • 105

1 Answers1

0

Have you tried using scrollTop?

e.g.

function scrollTextBox()
{
    var textBox = document.getElementById("<%= TextBox1.ClientID %>");
    textBox.scrollTop = 30;
}

You'll need to calculate the scrollTop value though using the line number.

Damon
  • 3,004
  • 7
  • 24
  • 28