Conditional ASP error
2 answers
Actually, I would do the following.
if (!string.IsNullOrEmpty(Request.Cookies("username")) &&
!string.IsNullOrEmpty(Request.Cookies("password")))
{
// Do your stuff, here :)
}
Get in the habit of using string.IsNullOrEmpty
for testing variables and string.Empty
for setting values if u doesn't want the string to be null
.
-2
source to share