javascript inside updatepanel
<p>im using javascript in asp.net gridview </p>

<pre><code>&lt;script type="text/javascript"&gt; 
      var currentRowId = 0;    
      function SelectRow()    
        {     
          if (event.keyCode == 40)     
          MarkRow(currentRowId+1);  
          else if (event.keyCode == 38)
          MarkRow(currentRowId-1);    
        }           
     function MarkRow(rowId)  
        {        
         if (document.getElementById(rowId) == null)           
         return;                   
         if (document.getElementById(currentRowId) != null )  
         document.getElementById(currentRowId).style.backgroundColor = '#ffffff';   
         currentRowId = rowId;       
         document.getElementById(rowId).style.backgroundColor = '#ff0000';  
        }     
    &lt;/script&gt;
    &lt;script type="text/javascript"&gt;
   var TargetBaseControl = null;   
   window.onload = function()
   {
      try
      {
         //get target base control.
         TargetBaseControl = 
           document.getElementById('&lt;%= this.GridView1.ClientID %&gt;');
      }
      catch(err)
      {
         TargetBaseControl = null;
      }
   }
   function TestCheckBox()
   {              
      if(TargetBaseControl == null) return false;

      //get target child control.
      var TargetChildControl = "chkSelect";

      //get all the control of the type INPUT in the base control.
      var Inputs = TargetBaseControl.getElementsByTagName("input"); 

      for(var n = 0; n &lt; Inputs.length; ++n)
         if(Inputs[n].type == 'checkbox' &amp;&amp; 
            Inputs[n].id.indexOf(TargetChildControl,0) &gt;= 0 &amp;&amp; 
            Inputs[n].checked)
          return true;        

      alert('Select at least one checkbox!');
      return false;
   }
    &lt;/script&gt;
</code></pre>

<p>button control:</p>

<p>" Width="80px" CssClass="button" /></p>

<p>im using ajax update panel in gridview ...i control postback level but the script is not working inside the updatepanel</p>
