i am trying to use an ASP conditional here:
if (Request.Cookies("username")) and (Request.Cookies("password")) <> "" Then
And i keep getting this error:
Type mismatch: '[string: ""]'
Any ideas what I am getting that?
Thanks,
Ryan
i am trying to use an ASP conditional here:
if (Request.Cookies("username")) and (Request.Cookies("password")) <> "" Then
And i keep getting this error:
Type mismatch: '[string: ""]'
Any ideas what I am getting that?
Thanks,
Ryan
try
if (Request.Cookies("username") <> "") and (Request.Cookies("password") <> "") Then
Actually, I would do the following..
if (!string.IsNullOrEmpty(Request.Cookies("username")) &&
!string.IsNullOrEmpty(Request.Cookies("password")))
{
// Do your stuff, here :)
}
Get into the habit of using string.IsNullOrEmpty
for testing variables and string.Empty
for setting values, if u don't want a string to be null
.