Advertisement

09.02.2008 at 03:31AM PDT, ID: 23695438
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3

Nested XML binded to datalist using PagedDataSource

Asked by DreamMaster in Programming for ASP.NET, .NET, Microsoft Visual Basic.Net

Tags: ,

Hello experts,

I am building a website where I am incorporating an XML that holds information on cars. Normally it wouldn't be much of a problem, but the problem starts for me with the structure of the XML. The pictures of each car, are held in a different table of the xml. I'll show a simplified version for simpler reading.

The attaching of this XML is done as following:

    Public Sub BindList()
        dsOccasions.ReadXml(xmlURL)

        With pdsOccasions
            .DataSource = dsOccasions.Tables("occasion").DefaultView
            .AllowPaging = True
            .PageSize = pageSize
            .CurrentPageIndex = currentPage
        End With
        dlOccasions.DataSource = pdsOccasions
        dlOccasions.DataBind()

Not too hard either right?

Now I am binding this data to a datalist, and the only problem I am having so far, is getting the picture to show. I only want the first picture of each car really for this datalist.

    <asp:DataList ID="dlOccasions" runat="server" RepeatColumns="2" RepeatDirection="Horizontal">
        <ItemTemplate>
            <div class="auto">
                <div class="autofoto"><img src="<%#Container.DataItem("foto")%>" border="0" width="132" height="100" style="border: 1px solid #9a9a9a;" alt="<%#Container.DataItem("merk") %> <%#Container.DataItem("model") %> <%#Container.DataItem("uitvoering") %>" /></div>
                <div class="autodetails">
                    <span class="merk"><%#Container.DataItem("brand") %></span><br />
                    <span class="modeluitvoering"><%#Container.DataItem("model") %> <%#Container.DataItem("build")%></span><br />
                    <img src="/images/spacer.gif" border="0" width="1" height="5" /><br />
                    <span class="bullet"><%#Container.DataItem("buildyear")%></span><br />
                    <span class="bullet"><%#GetFuel(Container.DataItem("fuel"))%></span><br />
                    <span class="bullet"><%#GetSchakelmethode(Container.DataItem("transmission"))%></span><br />
                    <span class="bullet"><%#CLng(Container.DataItem("milage"))%> km</span>
                </div>
            </div>
        </ItemTemplate>
       
    </asp:DataList>

I can get everything to display, except for the foto, so ="<%#Container.DataItem("foto")%> doesn't work. Now I expected that, but can anyone help me get this to work? I am almost there and feel it should be quite easy, but just can't get my skull to work as it should.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
<?xml version="1.0" ?> 
- <occasions>
- <occasion>
  <brand>ALFA ROMEO</brand> 
- <fotos>
  <foto nr="1">http://URL/77PNNG.jpg</foto> 
  <foto nr="2">http://URL/77PNNG_2.jpg</foto> 
  <foto nr="3">http://URL/77PNNG_3.jpg</foto> 
  <foto nr="4">http://URL/77PNNG_4.jpg</foto> 
  <foto nr="5">http://URL/77PNNG_5.jpg</foto> 
  <foto nr="6">http://URL/77PNNG_6.jpg</foto> 
  <foto nr="7">http://URL/77PNNG_7.jpg</foto> 
  </fotos>
  </occasion>
  </occasions>
 
Loading Advertisement...
 
[+][-]09.03.2008 at 04:00PM PDT, ID: 22382866

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.04.2008 at 03:15AM PDT, ID: 22385653

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.04.2008 at 09:54AM PDT, ID: 22389769

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming for ASP.NET, .NET, Microsoft Visual Basic.Net
Tags: ASP.NET, VB.NET, Internet Explorer, Firefox, Safari
Sign Up Now!
Solution Provided By: TKOTC
Participating Experts: 1
Solution Grade: A
 
 
[+][-]09.04.2008 at 11:51PM PDT, ID: 22395853

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628