title: VB.net and jQuery scrollintoview plugin - scroll to a specific "input" element
body: <p>I am trying to use <a href="http://erraticdev.blogspot.com/2011/02/jquery-scroll-into-view-plugin-with.html" rel="nofollow">scrollintoview jQuery plugin</a> on a vb.net webpage and unfortunately, being fairly new at jQuery I am running into a problem.</p>
  
  <p>I have a form that is pretty long with the submit button at the bottom. Validations are done in the code behind when the user clicks submit.</p>
  
  <p>In my validate() sub,
  I keep the ID of the control in error (say txtFirstName) in a variable ControlInErrorID<br>
      controlInErrorID = txtFirstName.ClientID</p>
  
  <p>I then attempt to scroll to the last control in error using a script manager:</p>
  
  <pre><code>If controlInErrorID &lt;&gt; String.Empty Then
      Dim csname1 As [String] = "ShowControlInErrorScript"
      Dim cstype As Type = Me.[GetType]()
  
      ' Get a ClientScriptManager reference from the Page class. 
      Dim cs As ClientScriptManager = Page.ClientScript
  
      ' Check to see if the startup script is already registered. 
      If Not cs.IsStartupScriptRegistered(cstype, csname1) Then
          Dim cstext1 As New StringBuilder()
          cstext1.Append("&lt;script type=text/javascript&gt;")
          cstext1.Append("$(document).ready(function () {")
          cstext1.Append("    $(""#" + controlInErrorID + """).scrollintoview({")
          cstext1.Append("        duration: 5000,")
          cstext1.Append("        direction: ""vertical"",")
          cstext1.Append("        complete: function() {")
          'cstext1.Append("// highlight the element so user's focus gets where it needs to be")
          cstext1.Append("    }")
          cstext1.Append("});})")
  
          cstext1.Append("&lt;/script&gt;")
          cs.RegisterStartupScript(cstype, csname1, cstext1.ToString())
      End If
  End If
  </code></pre>
  
  <p>Trouble is, when run this, I have no errors, but nothing happens. 
  Any idea please?</p>
  
  <p>Thanks a lot!</p>