Re: If( ) multiple conditions
From: Derek Harmon (loresayer_at_msn.com)
Date: 03/21/04
- Next message: Polaris: "Re: Is HTTP Stateless ?"
- Previous message: Miha Markic [MVP C#]: "Re: If( ) multiple conditions"
- In reply to: Andrew Banks: "If( ) multiple conditions"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 21 Mar 2004 13:29:28 -0500
"Andrew Banks" <banksy@nojunkblueyonder.co.uk> wrote in message news:TWk7c.22418$qi6.481283204@news-text.cableinet.net...
> How can I tst for multiple conditions in C#?
: :
> if(!Page.IsPostBack AND Request.QueryString["Refreshed"].ToString()=="1")
if ( !Page.IsPostBack && Request.QueryString[ "Refreshed"].ToString( ) == "1" )
'&&' does short-circuit (conditional) AND evaluation, which means if the page is posted
back it will not check the Request's query string.
If the second term had a side-effect, you might prefer '&' which is a logical AND that
checks both terms, even when the first term returns false.
Derek Harmon
- Next message: Polaris: "Re: Is HTTP Stateless ?"
- Previous message: Miha Markic [MVP C#]: "Re: If( ) multiple conditions"
- In reply to: Andrew Banks: "If( ) multiple conditions"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|