0

tryin' to render articles with pictures for each article. Im trying to use 2 nested ListView's and 2 querys in SQL Server 08 which i get in 2 methods from my 2 objectdatasources...

My ListViews look like this: http://pastebin.com/Lf1Evd1d and my code-behinde like this: http://pastebin.com/0YebPk15

Problem is I'm not really sure how to write the ItemDataBound. Im trying to get it to render with NyhetID connected with the each picture from the database. I think its wrong at the databound point. Just get an error which says that my method is non-generic and got something wrong with an ID...

If anyone got other suggestions on how to reneder out articles with picture for each article please share :)

Regards /Haris

1 Answer 1

1

I'm confused by your question, but the ItemDataBound event shouldn't work any differently for a nested control.

<asp:ListView ID="innerList" runat="server" OnItemDataBound="innerList_ItemDataBound" ...>

And in the code-behind:

protected void innerList_ItemDataBound(object sender, ListViewItemEventArgs e)
{

}    
Sign up to request clarification or add additional context in comments.

2 Comments

Sorry James, I'll try to rephrase my question. In my nested listview i want to render out each picture belogning to an article. On my itemdatabound i want to connect those picture ID's from my database that are connected with the article ID. Thing is i don't understand how to write the ItemDataBound to get it to work... As i understand first ListView renders out Article, when it gets to Eval"Picture" it looks for Articles ID to find an matching Picture...or am I thinkin wrong? And hey I appreciate you're respond!!
Eval"Picture" is in my inner listview as i forgot to mention

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.