Last post Jan 20, 2011 06:49 AM by egor598
Jan 20, 2011 03:50 AM|JohanVeldkamp|LINK
I am new to ASP.Net and have a lot of help with this forum, but sometimes you can't find your answer.
I am having a DataList on my page for small news items (like a newsreader), every newsitem has it's own image which comes out-of an other table.
How can I pass the News_imageId to my Imagequery?
<asp:SqlDataSource ID="SqlView_Image" runat="server"
<asp:Parameter DefaultValue="<%# Eval("News_Image") %>" Name="p1" Type="Int32" />
The underlined part gives an error, how can I solve this problemn?
The code above is set within the Datalist for the Newsreader.
Many thanks for your help,
Jan 20, 2011 06:49 AM|egor598|LINK
I don't think it's possible to do it in a declarative way, but it's possible to do it in the code-behind:
SqlView_Image.SelectParameters("p1").DefaultValue = News_Image