try binding your script on rowbound event of gridview something like:
protected void CustomersGridView_RowDataBound(Object sender, GridViewRowEventArgs e)
{
if(e.Row.RowType == DataControlRowType.DataRow)
{
// Registering javascript.
e.Row.Cells[your link button cell number].SetAttribute("onclick",your script to open modal popup);
}
}
this will solve your problem.