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. General Programming
  3. .NET (Core and Framework)
  4. TextBox Control

TextBox Control

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpdatabasedotnetquestion
5 Posts 4 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.
  • J Offline
    J Offline
    John L DeVito
    wrote on last edited by
    #1

    Heyas all, Is it possible, using the .NET framework, to programmatically determine if there is text in a textbox control or not. Say just a simple Bool value or something similiar. Basically I'm trying to build a query string dependant on what textboxes have text in them, if a textbox has text then include that text in the query if not, ignore completely. Is this possible or should I be going a completely different route? Thanks, John

    G H 2 Replies Last reply
    0
    • J John L DeVito

      Heyas all, Is it possible, using the .NET framework, to programmatically determine if there is text in a textbox control or not. Say just a simple Bool value or something similiar. Basically I'm trying to build a query string dependant on what textboxes have text in them, if a textbox has text then include that text in the query if not, ignore completely. Is this possible or should I be going a completely different route? Thanks, John

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Whatever textbox control you are talking about (web, windows or mobile), it has a Text property that you can use to get the text in the textbox. Simply check if the length of the string is zero or not. --- b { font-weight: normal; }

      J O 2 Replies Last reply
      0
      • G Guffa

        Whatever textbox control you are talking about (web, windows or mobile), it has a Text property that you can use to get the text in the textbox. Simply check if the length of the string is zero or not. --- b { font-weight: normal; }

        J Offline
        J Offline
        John L DeVito
        wrote on last edited by
        #3

        That would work perfectly, thanks a lot guffa :) Thanks, John

        1 Reply Last reply
        0
        • G Guffa

          Whatever textbox control you are talking about (web, windows or mobile), it has a Text property that you can use to get the text in the textbox. Simply check if the length of the string is zero or not. --- b { font-weight: normal; }

          O Offline
          O Offline
          Office Lineman
          wrote on last edited by
          #4

          Or simply check that the TextLength property is greater than zero. -- I've killed again, haven't I?

          1 Reply Last reply
          0
          • J John L DeVito

            Heyas all, Is it possible, using the .NET framework, to programmatically determine if there is text in a textbox control or not. Say just a simple Bool value or something similiar. Basically I'm trying to build a query string dependant on what textboxes have text in them, if a textbox has text then include that text in the query if not, ignore completely. Is this possible or should I be going a completely different route? Thanks, John

            H Offline
            H Offline
            HimaBindu Vejella
            wrote on last edited by
            #5

            TextBox1.Text.Equals("") may solve it or use TextBox1.Text.Length "Aim to go where U have never been B4 and Strive to achieve it" http://groups.yahoo.com/subscribe/dotnetforfreshres http://himabinduvejella.blogspot.com

            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