aspif可以分開判斷代碼的簡單介紹
1、Sql=quotselect name from wjfile where weburl=1 and ID=quotID end if url=articleaspwidd1aclassd1這個是文章收藏時所附加的url判斷,其余模塊也必須附件并修改,例如圖片的url=;sql=quotselect * from fangchanxinxi where xqmc=#39quotxqmcquot#39 and hxjg=#39quothxjgquot#39 and jg=#39quotjgquot#39 and lc=#39quotlcquot#39 and jzmj=#39quotjzmjquot#39quotrsopen sql,conn,1,1 if not rseof then response;那就在 endif 處 加一行 end if 簡單的看 你2個if 只有一個end if 你去掉下面的else 能運行是因為第2個if 后面then 你后面跟了zt=“b” 這樣就等這個if 結(jié)束了 可以不寫end if 但你加else 后 就必須有對應的。
2、exec=quotinsert into 會員a, b, c,d,e,fvalues#39quot+a+quot#39,quot+b+quot,#39quot+c+quot#39,#39quot+d+quot#39,#39quot+e+quot#39,#39quot+f+quot#39quot你的SQL寫得不對,這樣是jscript的,但你沒指定,所以系統(tǒng)默認應該用vbscript的語法 變量的連接;你的判斷應該寫在后臺中這樣寫 前臺lt%# BindTitleEvalquotTitlequot 后臺的cs文件中寫一個方法,如下public string BindTitleobject title if titleToStringLengthlt5 titleToString else title;多條件,如果條件個數(shù)不是很多可以這樣寫if T10 and T2=0 or T3lt0 then #39執(zhí)行語句 end if 但是多條件判斷一般采用條件控制語句select case 例如id=requestquotidquotselect case id case 1 #39執(zhí)行語句1 case 2。
3、if IsNumericdh=false then ResponseWrite quotwindowalert#39請輸入正確的電話號碼電話號碼只能為純數(shù)字!#39historyback1quotResponseEnd end if;你兩段代碼可以改下簡潔點lt%sql=quotselect * from newstype2 order by nu ,id descquotrs_type1=myRs1,sqlq=0while!rs_type1EOFq++style = quotquotifq%3==1 style = quot style=quotquot;if then 是條件判斷語句,如果需要兩個條件同時成立則需要加 and語法如下if 條件1 and 條件2 then 滿足條件執(zhí)行的代碼end if如果是或者的情況則需要用 or語法如下if 條件1 or 條件2 then 滿足其中一個條件所執(zhí)行的;rCount = rs1recordcount i = 0 if i lt rCount or daydate=8 and Sessionquotsession_adminrightquotlt 25 then #39時間判斷可以寫在這里% lta href=quotshow_bbasp?bbgl_bm_id=lt%=bbgl_bm_id%q。
4、dim rowcount call connExecutequotupdate tb set D=D+D1 where A=A1 and B=B1 and C=C1 and E=E1quot , rowcountif rowcount = 0 then call connExecutequotinsert into tbA,B,C,D,E select A1,B1;判斷不為空的時候再賦值,這樣才對rsopen sql1,conn,1,1 if not rseof then hmdd=rsquott10quotend if rsclose。
掃描二維碼推送至手機訪問。
版權(quán)聲明:本文由飛速云SEO網(wǎng)絡(luò)優(yōu)化推廣發(fā)布,如需轉(zhuǎn)載請注明出處。