How to nest 2nd datalist instead of gridview

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,078
Latest member
MakersCBDBlood

Latest Threads

Top