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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:44:10+00:00 2026-05-18T11:44:10+00:00

I have a web forms app with a CSS file for layout. One of

  • 0

I have a web forms app with a CSS file for layout. One of my elements, which will be much more difficult to do in CSS without using IDs, also has to have runat="server" since I control visibility server side.

<div id="x">
    <div id="whatever" runat="server" visible="false">
        <div id="y">
            ....
        </div>
    </div>
</div>

My problem is that in the CSS, I don’t know how to ignore that whatever div with my selectors, and unless I inline the CSS and put in server to client control translation, I won’t know the control names until runtime.

#x
{
    position:absolute;
    height:30px;
}

    #x #whatever??? #y img
    {
        margin:-7px 15px 0 30px;
    }

    #x #whatever??? div
    {
        width:250px;
        float:left;
    }
etc.

How should I work around this? Is there a server side container control that doesn’t render output but could be used to contol the visibility/rendering of its contents, or is there a trick in CSS to ignore that intermediate div?

This is additionally confused by the fact I have the x div in a master page and the whatever and y divs are both in the page itself. I know this wouldn’t be an issue if I were using MVC, but at this point switching is not an option.

  • 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-18T11:44:11+00:00Added an answer on May 18, 2026 at 11:44 am

    using CSS class selectors is a quick and easy way around this problem- not as fast as CSS id selectors but they will ALWAYS work (you could calculate the client ID of the “whatever” div element but this will change if you for example, move it into a Panel control, repeater control, etc.)

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

Sidebar

Related Questions

I have a simple ASP.NET 3.5 SP1 Web Forms app... I've added the System.Web.Routing
Using web forms I know that you can only have one ASP.NET form on
I have a web page with 3 forms on it. Not nested, just one
I have two CSS files in my web app: reset.css and screen.css. They appear
I have a web-app consisting of some html forms for maintaining some tables (SQlite,
We have, like everyone else, forms all over our web app. So far we've
I am working on an iPhone Web App using HTML & CSS. I have
Background : I currently have a Web Forms, ASP.NET 3.5/C# application which I'm interested
I'm creating a few web forms that have areas to them. Are fieldsets viable
I have a web report that uses a Django form (new forms) for fields

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.