Question : How can I check when CType fails?

I use the folllowing code but it says that '<>' is not define for this type of object. How can I check to make sure that updateButton is not null before enabling it?  Thanks.
Code Snippet:
1:
2:
3:
4:
Dim updateButton As Button = CType(row.FindControl("btnUpdate"), System.Web.UI.WebControls.Button)
                If updateButton <> Nothing Then
                    updateButton.Enabled = True
                End If

Answer : How can I check when CType fails?

you don't need the parenthesis...i just place them there.
Random Solutions  
 
programming4us programming4us