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 7950299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:13:36+00:00 2026-06-04T02:13:36+00:00

I create a div tag dynamically inside of a tag in C#(Asp.net) that will

  • 0

I create a div tag dynamically inside of a tag in C#(Asp.net) that will contain 3 dynamically generated buttons. I only want the div to display when the user mouses over the table cell(td tag). Can I acheive this throug .css?

The dynamic generation in C# looks like this:

HtmlTableCell cell = (HtmlTableCell)c;

                        HtmlInputButton PopupAddButton = new HtmlInputButton();
                        PopupAddButton.ID = "PBA" + c.ID.ToString();
                        PopupAddButton.Value = "Add";
                        PopupAddButton.Style["Height"] = "14px";
                        PopupAddButton.Style["Width"] = "40px";
                        PopupAddButton.Style.Add(HtmlTextWriterStyle.Top, "-100");
                        PopupAddButton.Style["right"] = "0";
                        PopupAddButton.Style["float"] = "left";
                        PopupAddButton.Style["vertical-align"] = "top";
                        PopupAddButton.Style["font-size"] = "9px";

                        HtmlInputButton PopupEditButton = new HtmlInputButton();
                        PopupEditButton.ID = "PBE" + c.ID.ToString();
                        PopupEditButton.Value = "Edit";
                        PopupEditButton.Style["Height"] = "14px";
                        PopupEditButton.Style["Width"] = "40px";
                        PopupEditButton.Style["top"] = "0";
                        PopupEditButton.Style["right"] = "0";
                        PopupEditButton.Style["float"] = "left";
                        PopupEditButton.Style["vertical-align"] = "top";
                        PopupEditButton.Style["font-size"] = "9px";

                        HtmlInputButton PopupDeleteButton = new HtmlInputButton();
                        PopupDeleteButton.ID = "PBD" + c.ID.ToString();
                        PopupDeleteButton.Value = "Delete";
                        PopupDeleteButton.Style["Height"] = "14px";
                        PopupDeleteButton.Style["Width"] = "40px";
                        PopupDeleteButton.Style["top"] = "0";
                        PopupDeleteButton.Style["right"] = "0";
                        PopupDeleteButton.Style["float"] = "left";
                        PopupDeleteButton.Style["font-size"] = "9px";
                        PopupDeleteButton.Style.Add(HtmlTextWriterStyle.VerticalAlign, "top");


                        PopupAddButton.Attributes.Add("onClick", "AddPopupControlToTableCell('" + cell.ClientID + "', '" + cell.Height.ToString() + "', '" + g_PopupControlId + "');");
                        PopupEditButton.Attributes.Add("onClick", "EditPopupControlToTableCell('" + cell.ClientID + "', '" + cell.Height.ToString() + "', '" + g_PopupControlId + "');");
                        PopupDeleteButton.Attributes.Add("onClick", "DeletePopupControlToTableCell('" + cell.ClientID + "', '" + cell.Height.ToString() + "', '" + g_PopupControlId + "');");

                        HtmlGenericControl ButtonDiv = new HtmlGenericControl("div");
                        ButtonDiv.ID = "buttonBlock" + c.ID.ToString();
                        ButtonDiv.Attributes.Add("class", "buttonBlock");

                        ButtonDiv.Controls.Add(PopupAddButton);
                        ButtonDiv.Controls.Add(PopupEditButton);
                        ButtonDiv.Controls.Add(PopupDeleteButton);

                        cell.Controls.Add(ButtonDiv);

my .css currently looks like this

.buttonBlock input{
  display:none;
}
td:hover #buttonBlock input{
 display:inline;
}

This does not work however. What am I doing incorrectly?

  • 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-04T02:13:37+00:00Added an answer on June 4, 2026 at 2:13 am

    try fixing this code first

    td:hover #buttonBlock input{
    display:inline;
    }
    

    to

    td:hover .buttonBlock input{
    display:inline;}
    

    your original was looking for an id of buttonBlock (#buttonBlock) when it should be looking for a class of buttonBlock (.buttonBlock)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a scrollable div tag with a fixed height that gets
I want to create 3 Div tags Dynamically when I press 3 different buttons
I am able to create div tag dynamically but unable to create form tag
I want to create in ASP.NET MVC 3 a link (in Ajax) with an
I have a piece of JavaScript that dynamically creates an A tag inside of
I'm working with jquery. I have an anchor tag that is generated dynamically in
dv = document.createElement('div'); // create dynamically div tag dv.setAttribute('id', lyr1); // give id to
I have items and buttons that are created dynamically and I want to show
I thought the following script will create div element but I got nothing output
I need to create a DIV that has some content (some of which is

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.