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
  • 8,796
  • 36
  • 82
  • 101

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
  • 2,987
  • 7
  • 21
  • 28