Question : My asp.net button is still not enabled even when I set it to enabled

Hi, I'm using vs2008, .net
The breakpoint is set at this loc and it's executed but the update button is still not ablled.  How can I address this?  thank you.
both buttons are not abled even code is executed and I can see the property is set to be abled.  I refresh the page again and nothing changes.  
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
Protected Sub gvWorkingDocs_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gvWorkingDocs.RowDataBound
        If e.Row.RowType = DataControlRowType.DataRow Then
            ' Get the DataKey Value of the grid row
            Dim newFileName As String
            newFileName = gvWorkingDocs.DataKeys(e.Row.RowIndex).Value.ToString()
            Dim updateButton As System.Web.UI.WebControls.Button
            Dim editButton As System.Web.UI.WebControls.Button

            'If a match is found then the doc is checked out
            For i As Integer = 0 To dsDocsLogs.Tables(0).Rows.Count - 1
                If dsDocsLogs.Tables(0).Rows(i)("NewFileName").ToString() = newFileName Then
                    'Fill in the status info
                    e.Row.Cells(8).Text = "Checked out by " + dsDocsLogs.Tables(0).Rows(i)("userName").ToString() & _
                    " @" + dsDocsLogs.Tables(0).Rows(i)("dateTime").ToString()

                    'Enable or Disable Update and Edit button
                    If dsDocsLogs.Tables(0).Rows(i)("userId").ToString() = userId Then
                        updateButton = CType(e.Row.FindControl("editWorkingDoc"), System.Web.UI.WebControls.Button)
                        updateButton.Enabled = True
                    Else 'else, disable the Edit button
                        editButton = CType(e.Row.FindControl("btnUpdate"), System.Web.UI.WebControls.Button)
                        editButton.Enabled = False
                    End If
                End If
            Next

        End If
    End Sub

Answer : My asp.net button is still not enabled even when I set it to enabled


updateButton = CType(e.Row.FindControl("editWorkingDoc"), System.Web.UI.WebControls.Button)

Shouldnt that be

updateButton = CType(e.Row.FindControl("btnUpdate"), System.Web.UI.WebControls.Button)


And samething for EditButton
Random Solutions  
 
programming4us programming4us