title: How to call javascript function in every row during itemdatabound
body: <p>Hi I have a javascript and I need to running it every row during datagrid itemdabound. However I used the below code and it only show one time only. Would someone tell me how to solve the problem. Thanks in advance.</p>
  
  <p>Code:</p>
  
  <pre><code>Private Sub dgrdConfirmed_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) _
    Handles dgrdConfirmed.ItemDataBound
  
      Select Case e.Item.ItemType
          Case ListItemType.Item, ListItemType.AlternatingItem, ListItemType.EditItem
              Dim dr As DataRow = CType(e.Item.DataItem, DataRowView).Row
  
             If (Not Page.ClientScript.IsStartupScriptRegistered(Page.GetType(), "addWarning")) Then
                  Dim cs As ClientScriptManager = Page.ClientScript
                  cs.RegisterStartupScript(Page.GetType(), "addWarning", 
                      "&lt;script language='javascript' type='text/javascript'&gt;addWarning 
                      ();&lt;/script&gt;")
              Else
                  Dim lt As New Literal
                  lt.Text = "&lt;script type='text/javascript'&gt;addWarning()&lt;/script&gt;"
                  lt.Mode = LiteralMode.Transform
  
  
             End If
       End Select
  End Sub
  </code></pre>
  
  <p>There is my javascript:</p>
  
  <pre><code>&lt;script type="text/javascript" &gt;
          function addWarning(e) {
              alert('addWarning');
  
          }
  
  &lt;/script&gt;
  </code></pre>