in c# if are short circuited
if (a && b)
if a is false, b will not be evaluated. this is not tue for vb, you will
need to do two if statements. assuming i can remember vb syntax at all:
If not Request.Cookies("level") is nothing then
if Server.HtmlEncode(Request.Cookies("level").Value) = "admin" Then
end if
end if
also have no idea why you call Server.HtmlEncode().
-- bruce (sqlwork.com)
"David C" wrote:
Just curious. Why do you use Request.Cookies in one stmt and
Server.HtmlEncode(Request.Cookies... in another? Are they equivalent?
David
"gerry" <ge***@newsgroup.nospamwrote in message
news:O9*************@TK2MSFTNGP06.phx.gbl...
not sure about the VB syntax , in c# it would be something like :
if ( Request.Cookies["level"]!=null &&
Server.HtmlEncode(Request.Cookies["level"].Value) == "admin" )
{
}
"David C" <dl*****@lifetimeinc.comwrote in message
news:uj**************@TK2MSFTNGP02.phx.gbl...
Is there a way to check to see if the browser accepts cookies? I have
the following line of code that is giving an error "Object reference not
set to an instance of an object."
with the following line:
If Server.HtmlEncode(Request.Cookies("level").Value) = "admin" Then
Thanks.
David