By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,081 Members | 862 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,081 IT Pros & Developers. It's quick & easy.

How to tell TextBox.Text is null or not

P: n/a
Hi,
I want to tell if the .NET textbox.text control on the web page has been
input or not
So I write
If TextBox.Text <> "" then
.....
End IF
But you know it does not work , the error
"'text' is not a member of 'String'."
How to do it properly ?
Thanks for any input.
Henry
Dec 7 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
What is TextBox?

it should look osmething like:
<asp:textbox id="Name" runat="server" />

codebehind:

Protected Name as TextBox

sub Page_Load
if not Name.Text is nothing andalso name.Text.Length > 0 then
..
end if
end sub

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Henry Lee" <lh****@dynamiceng.com> wrote in message
news:%2*******************@TK2MSFTNGP15.phx.gbl...
Hi,
I want to tell if the .NET textbox.text control on the web page has
been input or not
So I write
If TextBox.Text <> "" then
.....
End IF
But you know it does not work , the error
"'text' is not a member of 'String'."
How to do it properly ?
Thanks for any input.
Henry

Dec 7 '05 #2

P: n/a
Or if you're on 2.0,
If Not String.IsNullOrEmpty(Name.Text) Then
....
End If
Dec 7 '05 #3

P: n/a
Len() works the same..

"Keith Patrick" <ri*******************@nospam.hotmail.com> schreef in
bericht news:%2*******************@tk2msftngp13.phx.gbl...
Or if you're on 2.0,
If Not String.IsNullOrEmpty(Name.Text) Then
...
End If

Dec 8 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.