View Single Post
  #69 (permalink)  
Old 08-28-2007, 04:28 AM
H2o H2o is offline
D-Web Analyst
 
Join Date: Jul 2007
Posts: 246
H2o is on a distinguished road
Thumbs up Re: ASP.NET Data Controls

Hi guys,

I am trying send an email when a row in my gridview has been updated based on a checkbox in grideview = true.
I Keep getting the error "object reference not set to an insatnce of an object"
I am assuming that this is because the code isn't finding the checkbox.
I have editing enable for the gridview.....What is the name of the checkbox ( in edit mode ) in the grid view.
My aspx page contains <asp:CheckBoxField DataField="ApprovedBy_HR"
What should my code behind use to refernce this..
I tried the following
Dim VarHRApproved As CheckBox = CType(GridView1.FindControl("ApprovedBy_HRCheckBox "), CheckBox)
If VarHRApproved.Checked = True Then
'create the mail message
Thx in advance,
__________________
H2O

Without us, no one can survive..
Reply With Quote