We help IT Professionals succeed at work.

check if user typed in asp textbox

maqskywalker
maqskywalker asked
on
87 Views
Last Modified: 2018-12-10
I'm using ASP.NET Web Forms.

In a ASP TextBox that holds a string, how do i check if a user typed in the textbox?
Sometimes the textbox might contain a string already on page load. I'm not checking if the textbox is empty.
I want to check if the user typed anything in the textbox.


So on button click if they user typed anything in the textbox

Then set this variable CheckTextBoxTyped = "Yes"

If nothing was typed in the texbox set this variable CheckTextBoxTyped = "No"


Right now i have this:



    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    Dim CheckTextBoxTyped As String

    CheckTextBoxTyped = "Yes"


    CheckTextBoxTyped = "No"

    End Sub
Comment
Watch Question

Director, Information Systems
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
thanks