Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. want to give cssclass to a string

want to give cssclass to a string

Scheduled Pinned Locked Moved ASP.NET
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bhavna4321
    wrote on last edited by
    #1

    i want to apply font size and color which i had in one of the cssclass in stylesheet.I want to apply it on the string . Can anyone please let me know how it is done.

    S K 2 Replies Last reply
    0
    • B bhavna4321

      i want to apply font size and color which i had in one of the cssclass in stylesheet.I want to apply it on the string . Can anyone please let me know how it is done.

      S Offline
      S Offline
      Spunky Coder
      wrote on last edited by
      #2

      Why do you want to apply a CssClass to a string variable?:confused: If you are trying to show string (or text) with specific font size , apply the CssClass to the control through which you are displaying the string. (For e.g. a Label would serve the purpose)

      "Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)

      B 1 Reply Last reply
      0
      • S Spunky Coder

        Why do you want to apply a CssClass to a string variable?:confused: If you are trying to show string (or text) with specific font size , apply the CssClass to the control through which you are displaying the string. (For e.g. a Label would serve the purpose)

        "Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)

        B Offline
        B Offline
        bhavna4321
        wrote on last edited by
        #3

        that's the problem . it has to be applied to only part of the string which is text of a textbox.

        S 1 Reply Last reply
        0
        • B bhavna4321

          i want to apply font size and color which i had in one of the cssclass in stylesheet.I want to apply it on the string . Can anyone please let me know how it is done.

          K Offline
          K Offline
          kumar_k508
          wrote on last edited by
          #4

          Hi, You can assign your string value to a label and assign style sheet for that label ,... hope this will help u...

          1 Reply Last reply
          0
          • B bhavna4321

            that's the problem . it has to be applied to only part of the string which is text of a textbox.

            S Offline
            S Offline
            Spunky Coder
            wrote on last edited by
            #5

            Ok...I think you cannot do it using a normal TextBox...Probably the other way would be to write your own custom TextBox control and render the text as according to your requirement.

            "Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups