[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

flow layout issue with datalist

Posted on 2007-11-27
3
Medium Priority
?
1,693 Views
Last Modified: 2012-06-21
hi there,
I have tried using the repeatlayout using the flow option although it seems to insert a line break after each element.  The code segment produces the following html.
               
                <span id="myfavourites"><span>
                    <div class="fav-box">
                        <img src="" alt="" />
                        <div class="fav-title">
                            test video
                        </div>
                        <div class="fav-content">
                           
                        </div>
                    </div>

                </span><br /><span>
                    <div class="fav-box">
                        <img src="/x" alt="" />
                        <div class="fav-title">
                           dsa
                        </div>
                        <div class="fav-content">
                            dsa
                        </div>
                    </div>

                </span><br /><span>


As you can see the last line for each record </span><br /><span> which I dont want.  Can this be removed?  Or can I use a different asp control to get around this?  

Many thanks

<asp:DataList ID="myfavourites" runat="server" RepeatLayout="Flow">
                <ItemTemplate>
                    <div class="fav-box">
                        <img src="<%# DataBinder.Eval(Container.DataItem, "") %>.jpg" alt="" />
                        <div class="fav-title">
                            <%# DataBinder.Eval(Container.DataItem, "") %>
                        </div>
                        <div class="fav-content">
                            <%# DataBinder.Eval(Container.DataItem, "") %>
                        </div>
                    </div>
                </ItemTemplate>
                </asp:DataList>

Open in new window

0
Comment
Question by:jimbona27
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
Oliver Amaya earned 1600 total points
ID: 20359870
Hi, set the following properties in your DataList:

RepeatDirection="Horizontal"
RepeatColumns="# of items in your datasource"

I think that should do the trick.
0
 

Author Comment

by:jimbona27
ID: 20364229
thanks great stuff
0
 

Author Comment

by:jimbona27
ID: 20451419
in the rendered html .net creates the following

                    <ul>

                        <span id="ctl07_TopNav_DataList"><span>
                            <li>xxx</li>
                        </span><span>
                            <li>xxx</li>
                        </span><span>
                            <li>xxx</li>
                        </span></span>

                    </ul>


any ideas how I can remove the
                        "<span id="ctl07_TopNav_DataList"><span>"

it brakes my validation with w3c!
argh!

thanks
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question