im'trying to validate that someone registering a new user does not
name im 'admin' or something like that
i'm using
bool bInvalidUsername = false;
bInvalidUsername = this.txtUserName.Text.ToLower().IndexOf("admin")>
-1 ?true:false;
but i always get
error: 'this.txtUserName.Text.ToLower' does not exist or a variant of
the message
?this.txtUserName.Text
"admin1234"
?this.txtUserName.Text.ToLower().IndexOf("admin")
error: 'this.txtUserName.Text.ToLower' does not exist
?this.txtUserName.Text.IndexOf("admin")
error: 'this.txtUserName.Text.IndexOf' does not exist
what am i doing wrong thanks
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"gh0st54" <gh0...@hotmail.com> wrote in message
news:7fa3be06.04102...@posting.google.com...
if you get these messages are runtime, then it means this.txtUserName.Text
is not a string. try:
bool bInvalidUsername =
this.txtUserName.Text.ToString().ToLower().IndexOf("admin") > -1 ? true :
false;
-- bruce (sqlwork.com)
"gh0st54" <gh0...@hotmail.com> wrote in message
news:7fa3be06.04102...@posting.google.com...
thanks for the reply
they are run-time in the immediate window in debug.
i found my problem which was not caused by the indexOf
but it's still weird that you get the error
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message news:<egwxTo4t...@TK2MSFTNGP15.phx.gbl>...