473,394 Members | 1,887 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Check empty variable. Strange problem. Need Help.

Hello,

I need to check if a textbox is returning an empty value.
When I use Response.Write(myTextBox.Text) I get the written value.

However, when I use the code:
If myTextBox.Text Is Nothing Then
Response.Write("Empty")
End If

"Empty" doesn't show even if I don't write anything in the text box.
Am I doing something wrong?

Thanks,
Miguel

Nov 19 '05 #1
1 1295
You use "Nothing" to see if an object exists or not.
To see if your TextBox has something, check it's Length property. If it's 0
then you don't have anything in the TextBox.
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello,

I need to check if a textbox is returning an empty value.
When I use Response.Write(myTextBox.Text) I get the written value.

However, when I use the code:
If myTextBox.Text Is Nothing Then
Response.Write("Empty")
End If

"Empty" doesn't show even if I don't write anything in the text box.
Am I doing something wrong?

Thanks,
Miguel

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: arenaTR | last post by:
I have a group of five checkboxes that I need to check in a script after a post-operaiton. I was using the code: $drv1 = $_POST but if the user left checkbox "driving_1" empty, i get a php...
32
by: Nuno Paquete | last post by:
Hi group. I'm using this code to see if is there any parameter for variable "menu": if($_GET == "downloads") .... But this code log errors if there is no parameter passed (this heappens at...
6
by: Joshua Weston | last post by:
I am new to C++ and I am very interested in becoming proficient. This post is two-fold. One, I am having problems with this small test program. It is meant to allow user input to control a "@"...
3
by: Mark Turney | last post by:
Problem: I have a vector full of two different derived class objects (class B and class C) that are derived from the same base class A. I want to loop through vector and invoke a member function...
0
by: Robert Harty | last post by:
Hello all, I have a strange problem with a HtmlTable control, which is dynamically created based on the results of a query. Each row in the table has a LinkButton added to it. When I create...
21
by: M D | last post by:
You know how you assume you know until you find out you don't know. Well, I typed into a function definition "..., new String("")). I know what I want. Everyone reading this knows what I want....
5
by: Shapper | last post by:
Hello, I am using this code line to check i a variable exists: If cookie Is Nothing Then .... How can I check if cookie is empty when cookie exists? Thanks, Miguel
4
by: Laphan | last post by:
Hi all In my functions I'm using a double-check all the time to trap if a value has nothing in it and my question is do I need this double-check. My check line is: IF IsNull(xxx) OR...
8
by: Neil Webster | last post by:
Hi, I was wondering whether anybody could help me out. I have a program, for part of it I am trying to pass a variable to a glob function, this returns an empty list. The strange thing is...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.