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. Textbox to align right

Textbox to align right

Scheduled Pinned Locked Moved ASP.NET
3 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
    bubberz
    wrote on last edited by
    #1

    I have a textbox that I need to populate data with align=right I have it's label and this textbox w/in

    tags. The label aligns right, but the text in the textbox stays on the left.

    D S 2 Replies Last reply
    0
    • B bubberz

      I have a textbox that I need to populate data with align=right I have it's label and this textbox w/in

      tags. The label aligns right, but the text in the textbox stays on the left.

      D Offline
      D Offline
      DELETEUSER
      wrote on last edited by
      #2

      // Hopefully your code behing is CS // If so do this TextBox1.Style["TEXT-ALIGN"] = TextAlign.Right.ToString(); // It works for me ---------- Venus Patel http://patelsinc.blogspot.com/ A student knows little about a lot. A professor knows a lot about little. I know everything about nothing.

      1 Reply Last reply
      0
      • B bubberz

        I have a textbox that I need to populate data with align=right I have it's label and this textbox w/in

        tags. The label aligns right, but the text in the textbox stays on the left.

        S Offline
        S Offline
        sstocker
        wrote on last edited by
        #3

        The above method will not work cross-browser (at least not in my experience). Use CSS instead by attaching a class to the textbox and in your css, set text-align: right; to your class. Do it like this: In the CSS: .yourclass { text-align: right; } Hope that helps.

        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