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

  • SEARCH
  • Home
  • 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 7610439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:25:07+00:00 2026-05-31T01:25:07+00:00

I want to populate a List dynamically and display the list when i hover

  • 0

I want to populate a List dynamically and display the list when i hover over a button

<div class="invite">
    <asp:Button ID="Button1" runat="server" Text="Invite"  CssClass="invite-link"/>
    <div class="invite-drop">
        <div class="holder">
            <ul runat="server">
                <li>
                    <a href="#">
                        <img src="images/img3.png" width="22" height="22" alt="image description" />
                        <span>Chris Robin</span>
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="images/img3.png" width="22" height="22" alt="image description" />
                        <span>Danny Defoee</span>
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="images/img3.png" width="22" height="22" alt="image description" />
                        <span>Gustav Lee</span>
                    </a>
                </li>
                <li>
                    <a href="#">
                        <img src="images/img3.png" width="22" height="22" alt="image description" />
                        <span>Eric Rees</span>
                    </a>
                </li>
            </ul>
            <a class="select" href="#">Or select friend</a>
        </div>
    </div>
</div>

My list is as follows and i am trying to construct it dynamically :

HtmlGenericControl list = new HtmlGenericControl("ul");
for (int i = 0; i < 3; i++)
{
    HtmlGenericControl listItem = new HtmlGenericControl("li");
    HtmlGenericControl anchor = new HtmlGenericControl("a");
    Image im = new Image();
    //im.ImageUrl = ds.Tables[0].Rows[1].ItemArray.ToString();
    anchor.Attributes.Add("href", "");
    anchor.Controls.Add(im);
    anchor.InnerText = "TabX";
}

EDIT :

enter image description here

i have been successful in transferring the list from codebehind however the formatting isnt correct want to display the images one below the other

My question is how do i transfer it to aspx design page? and display it on the hover event

Please help

  • 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-05-31T01:25:08+00:00Added an answer on May 31, 2026 at 1:25 am

    Add the dynamically created ul from server side into Page controls collection or anywhere on the page and make it hidden by default through css or inline style display:none. Give an id or class to ul which will help to find the element on the client side.

    On the client you can find it using $('ul.classname') or $('#listId) and then show it using show() on the hover event and position it as per your requirement.

    Based on your code.

    Give an id to ul

    <ul ID="list" runat="server">
    

    Note in the for loop you should add the anchor to the list control.

        for (int i = 0; i < 3; i++)
        {
            HtmlGenericControl listItem = new HtmlGenericControl("li");
            HtmlGenericControl anchor = new HtmlGenericControl("a");
            Image im = new Image();
            //im.ImageUrl = ds.Tables[0].Rows[1].ItemArray.ToString();
            anchor.Attributes.Add("href", "");
            anchor.Controls.Add(im);
            anchor.InnerText = "TabX";
    
            list.Controls.Add(anchor);
         }
    

    Js

    $('.invite-link').hover(function(){
         $('#list').show();
    }, function(){
         $('#list').hide();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to populate GridView below with images: <asp:GridView ID=GrdDynamic runat=server AutoGenerateColumns=False> <Columns> </Columns>
I want to dynamically populate an un-ordered list in a Div section. But, I
I want to populate a list activity class with my custom object Person ,
For example, I want to populate a gridview control in an ASP.NET web page
Probably something stupid I'm doing. I want to populate a hidden DIV with values
I want to create content type with multiple ListBox's which populate dynamically depending on
I populate web form with dynamic list of exams from database. I want user
I have a list that is dynamically populated, I want to get the indices
I have an NSOutlineView that I want to populate with a list of NSURL
I have a textfield and I have a list. I want to populate the

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.