S
staeri
I have one datalist containg another datalist in the ItemTemplate. I
used to have a gridview inside the datalist instead but I'm trying to
change that to another datalist but the code for binding the inner
datalist doesn't work:
Protected Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.DataListItemEventArgs)
Dim s As SqlDataSource = e.Item.FindControl("SqlDataSource2")
s.SelectParameters("AccountGroup").DefaultValue =
e.Item.DataItem("AccountGroup")
End Sub
I receive an error message telling me "Object reference not set to an
instance of an object."
What can be wrong?
Regards,
S
used to have a gridview inside the datalist instead but I'm trying to
change that to another datalist but the code for binding the inner
datalist doesn't work:
Protected Sub DataList1_ItemDataBound(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.DataListItemEventArgs)
Dim s As SqlDataSource = e.Item.FindControl("SqlDataSource2")
s.SelectParameters("AccountGroup").DefaultValue =
e.Item.DataItem("AccountGroup")
End Sub
I receive an error message telling me "Object reference not set to an
instance of an object."
What can be wrong?
Regards,
S