Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing DataList Value to User Control

Status
Not open for further replies.

jtgurkin

Technical User
Sep 16, 2002
47
US
I am trying to pass a datalist value to a user control like this:
<asp:DataList RepeatColumns="2" runat=server ID=features DataSourceId=VfiData HorizontalAlign=center >
<ItemStyle BorderWidth="7" BorderColor="#0A2B32" HorizontalAlign=center />
<ItemTemplate>
<vfi:ItemDetail ID=ItemDetail1 ItemID='<%#Container.DataItem("ItemID").ToString %>' runat=server />

</ItemTemplate>
</asp:DataList>

When I try to run the page i get the following error
Object variable or With block variable not set

It is not passing the value through. I do have a databind set up and if i remove the control and just put <%#Container.DataItem("ItemID").ToString %>, the proper value is displayed.

thanks
 
You are using the ToString method without paretheses. The problem might be related to that?

Tom
emo_big_smile.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top