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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:27:28+00:00 2026-05-27T08:27:28+00:00

I have a created a user control that is hopefully going to be used

  • 0

I have a created a user control that is hopefully going to be used across several sites. The problem that I am having is that these sites may all have different color schemes. I was wondering how I might be able to make a template for the control, and then based on the developer’s site, they will pass a parameter that indicates the color scheme they require, and the user control will update appropriately. I am very new to .NET, so please bear with me if this is a trivial question. I tried researching online, but most examples were either more complex, or just changed colors of panels, instead of changing css styles.

The control (.ascx) is as listed below:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="EmployeeSearch.ascx.cs" Inherits="Controls_EmployeeSearch" ClassName="EmployeeSearch" %>

<div id="divUserEntry" runat="server">
    <center>
        <br />
        <!-- This is the title for the employee search-->
        <div id="employeeTitle" class="LookupTitle">
            <center>Select Employee</center>
        </div>
        <!-- Div for the actual search elements -->   
        <div id="searchPeople" class="searchPeople">
            <div id="addedPerson" class="addedPerson">
            </div>
            <asp:TextBox ID="txtUserEntry" class="searchTextBox" runat="server" Text="Enter Name or ID" onFocus="this.value = ''" CssClass="searchTextStyle"></asp:TextBox>
            <asp:HiddenField ID="currentSearch" name="currentSearch" Value="notANormalValue" />

            <div id="searchResults" class="searchResults">
                Search for employee to manage.
            </div> 
        </div>
        <br />
        <asp:Button ID="btnSubmitEmployee" runat="server" Text="Submit" />
    </center>
</div>

Then I register it like this:

<%@ Register TagPrefix="uc" TagName="EmployeeSearch" Src="~/Controls/EmployeeSearch.ascx" %>

and just call it with this:

<uc:EmployeeSearch ID="searchContent" runat="server" />

I know that I can add a property in the uc call, but I am not sure what to do to get the divs to update correctly. Does anyone have a suggestion? Thanks in advance!

  • 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-27T08:27:29+00:00Added an answer on May 27, 2026 at 8:27 am

    usercontrols inherit the css from the aspx or site.master pages so what you could do is in each css either add

    #divUserEntry{color:#fff;}
    

    or set a css class and then your div

    <div id="divUserEntry" runat="server" class="usercontrol">
    

    but still in each css they have to add

    .usercontrol{color:#fff;}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a user control (CheckedDirTree) that exposes a CheckedFolder property which in
I have a user control that I've created, however when I go to add
I have created a user control that contains a button. I am using this
I have created a WinForms user control that is a set of five cascading
I have this problem where I have created a User Control which mimics a
I have created a custom user control that is meant to extend the functionality
I have created a User Control in my application that has a textbox and
I have an ObservableCollection that is created in user control that contains a custom
I have created a user control that will contain a table of LinkButtons (and
I have created one user control and need to convert that user control into

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.