need help with ClientScript logic
Posted on 2007-04-09
i have the following logic in an onclick method for a button on my page - basically when someone clicks the button, I iterate through each row in the gridview to see whether the checkbox on that row has been selected, and if so, to update the row with some logic in this method... I wanted a confirm type alert to appear if one of the fields of the selected row was already pre-populated. I can't get the return confirm logic to work - no matter what the user clicks 'OK' or 'cancel', the update occurs. I'm missing something totally obvious but can't figure it out... can someone help?
Sub btnAssign (ByVal.....)
For i as Integer = 0 to gridD.Rows.Count-1
Dim cb as CheckBox = CType(gridD.Rows(i).FindControl("Checkbox"), CheckBox)
If not gridD.Rows(i).Cells(8).Text = " " then
ClientScript.RegisterStartupScript(Me.GetType(), "", String.Format("confirm('Warning!... Overwrite?');", true)
'update logic here....