Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8196839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:36:38+00:00 2026-06-07T05:36:38+00:00

First question on S.O. I have to do a search result page in asp.net

  • 0

First question on S.O.

I have to do a search result page in asp.net and I have some problems
– I will have (for each “box”) an image of the book cover and the title of the book

Knowing that all images aren’t the same height, I want to be able to vertically align them to bottom. I searched really hard on the web and found some solution using display table/table-row/table-cell.

Everything works fine, using ListView‘s GroupTemplate (as row) and ItemTemplate (as cell) If i only want to display images – but – I want images vertically aligned to bottom and the book’s title below (with a link like “learn more” below the title).

Knowing that I couldn’t put my book title in the same cell than the image (because sometime the title will take two lines, which will break the design again…), I think that I would need another row (like in my code below). I tought that putting my two rows in GroupTemplate would work but ListView doesn’t seem to give me the hability to call two different itemtemplates (one for the image and one for the text placed in another row, below his image).

Any help would be greatly appreciated and if you have other alternatives, I’m opened to suggestions. Bear in mind that I need a DataPager so the ListView– i think – is the only way to go.

Here’s my css

#grid{
    background: lightgreen;
    border-spacing: 10px;
    display: table;
}
#grid .row{display: table-row;}
#grid .result{
    display: table-cell;
    vertical-align: bottom;
}

Here’s my search result ListView draft (image is good, but only crappy “test” text)

<asp:ListView ID="lvSearchResults" runat="server" OnPagePropertiesChanged="DataPager_PreRender" OnPagePropertiesChanging="DataPager_PreRendering" GroupItemCount="5" >
        <LayoutTemplate>
            <div id="grid">
                <asp:PlaceHolder ID="groupPlaceholder" runat="server" />
            </div>
        </LayoutTemplate>
        <GroupTemplate>
            <div class="row">
                <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
            </div>
            <div class="row">
                <asp:PlaceHolder ID="itemPlaceHolder1" runat="server" />
            </div>
        </GroupTemplate>
        <ItemTemplate>
            <div class="result">
                <p><a href='<%# Container.DataItem.URI %>'><img src='<%# Container.DataItem.LesImages.Petite %>' alt="" /></a></p>
            </div>
        </itemtemplate>
        <ItemTemplate>
            <div class="result">
                <p><a href='<%# Container.DataItem.URI %>'>test</a></p>
            </div>
        </itemtemplate>
    </asp:ListView>

Thanks a lot,
– Eric

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:36:38+00:00Added an answer on June 7, 2026 at 5:36 am

    Somehow I’ve been able to do what I wanted:

    By giving a fixed height to the remaining content (title and a link), the images continues to be vertically aligned. So in my particular case, no need to create a second row in the groupTemplate.

    Fixed height for my title because it can take (but not more) two lines or only one line. Since the link below my title is the same for every itemTemplate itteration, no need to specify height for his block.

    Thanks MajoB for your answer, but somehow it didn’t work for me.

    Here is my new and improved code… 😉

            <GroupTemplate>
                <div class="row">
                    <asp:PlaceHolder ID="itemPlaceholder" runat="server" />
                </div>
            </GroupTemplate>
            <ItemTemplate>
                <div class="result">
                    <a href='<%# Container.DataItem.URI %>'><img src='<%# Container.DataItem.LesImages.Petite %>' alt="" /></a>
                    <div style="height: 40px;margin-top: 10px;"><asp:Literal ID="litTitre" runat="server" Text='<%# TrunkStringRelay(Container.DataItem.Titre, 40) %>' /></div>                    
                    <a href='<%# Container.DataItem.URI %>'>En savoir plus &raquo;</a>
                </div>
            </itemtemplate>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi and thanks for your attention. First some background on the question: I have
I have a question about equivalent search result, that can occur on different fields.
.NET 3.5, C# I have a web app with a search feature. Some of
Here's my new question: On a search results page we have 12 products shown.
this is my first question I have searched for any launching activity questions and
Hello this is may first question and I have found so far the following
My first question on codeigniter. I have integrated paypal in codeigniter using paypal library.
my first question here! I have a problem with a piece of code that
This is my first question. I have an app in which i want to
this is my first question.. so, here we go. i have a site, 100%

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.