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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:47:22+00:00 2026-05-24T17:47:22+00:00

Lets say I have an asp.net label that has the value: Label1.Text = Hello

  • 0

Lets say I have an asp.net label that has the value:

Label1.Text = “Hello my name is Robert, the ID value is 20”

and I wanted to apply bold to the name “Robert” and the ID “20”.

And green for his name and red for the value…
I cannot apply a CSS style to the entire Label because it would make every text value a certain style. How can I apply CSS to something like this? I dont want to embed <strong> tags within the label like this:

Label1.Text = "Hello my name is <strong>Robert</strong>..."

  • 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-24T17:47:23+00:00Added an answer on May 24, 2026 at 5:47 pm

    You need to mark up the name and the ID in some way.

    Example:

    Label1.Text = "Hello my name is <span class=""name"">Robert</span>, the ID value is <span class=""id"">20</span>"
    

    CSS

    #label1 .name {
        color: green;
        font-weight: bold;
    }
    #label1 .id {
        color: red;
        font-weight: bold;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET MVC 3 application, that resides in lets say localhost/myapp under
I've always wondered, lets say you have two asp.net websites running in the same
Lets say I have an ASP.Net MVC App and this app (UI) references a
I have made an asp.net page which executes a long sp. lets say the
I'm a C#, ASP.NET newbie. Let's say I have an existing C# project (from
Lets say I have the following pages: # Include.asp <% Response.Write IsIncluded() & <br>
So I have an asp:imagebutton for lets say loginning into a web site. OnClick
Lets Say i have a table like this WEB_LIST_TABLE KEY Value ---------------------------------------- 134 google.com
Lets say I have a WCF service that a client can use to receive
I have an asp.net site that I need to have a popup/layer/alert happen when

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.