I have a button (btnADD)in the footer of a datagrid for adding new rows to the grid. Initially I am setting the enabled property to false, then I want to enable the button when data is entered into a specific textbox (also in the footer). I'm using the ontextchanged event to run:
Sub EnableAddButton(sender As Object, e As System.EventArgs)
'Dim btnAdd as button = e.Item.FindControl("btnAdd")
Dim btnAdd as button=CType(FindControl("btnAdd"), button)
btnAdd.enabled="true"
End Sub
I'm getting the following error:
Object reference not set to an instance of an object.
Obviously I don't have this wired up properly and I'm looking for guidance. I think I'm not using the correct parameters in the sub. I've tried others, but I haven't hit upon the right one. I've also dimmed btnAdd as shown with the line that is commented out. It gives the same error.
Thanks....Franco
Sub EnableAddButton(sender As Object, e As System.EventArgs)
'Dim btnAdd as button = e.Item.FindControl("btnAdd")
Dim btnAdd as button=CType(FindControl("btnAdd"), button)
btnAdd.enabled="true"
End Sub
I'm getting the following error:
Object reference not set to an instance of an object.
Obviously I don't have this wired up properly and I'm looking for guidance. I think I'm not using the correct parameters in the sub. I've tried others, but I haven't hit upon the right one. I've also dimmed btnAdd as shown with the line that is commented out. It gives the same error.
Thanks....Franco