Sort of a Newbie to .net here, having difficulties with my control, argh. Here is the code.
So my control is found and working, not getting the control not found. However my GridView1 is bound to an SQL statement. here is that snip
How can I get that information into my routine. Puzzled at what I am missing here.
Code:
Dim row As GridViewRow
Dim chkSelected As System.Web.UI.WebControls.CheckBox
Dim strstorename As String
For Each row In GridView1.Rows
chkSelected = row.FindControl("ITEMCHECKBOX")
If (Not chkSelected Is Nothing) Then
If chkSelected.Checked Then
'strstorename = CType(row.FindControl("CUSTNAME"), TextBox).Text
'strstorename = (row.DataItem("CUSTNAME").ToString
strstorename = DataBinder.Eval(row.DataItem, "CUSTNAME").ToString()
Label2.Text = "The store name is <b>" & strstorename & "</b>"
Else
Label2.Text = ""
End If
Else
Label2.Text = "Control Not Found"
End If
Next
So my control is found and working, not getting the control not found. However my GridView1 is bound to an SQL statement. here is that snip
Code:
<asp:BoundField DataField="CUSTNAME" HeaderText="CUSTNAME" SortExpression="CUSTNAME" />
How can I get that information into my routine. Puzzled at what I am missing here.