asp頁面裡if語句問題,ASP頁面裡,IF語句問題

時間 2021-12-27 23:14:40

1樓:匿名使用者

elseif rs("select")=b then<% if tryoperator="jn" and tryownerarea="江南(44140254)" then%>

<% elseif tryoperator="wz" and tryownerarea="五洲(44140253)" then%>

<% elseif tryoperator="xz" and tryownerarea="新中(44140252)" then%>

2樓:匿名使用者

你看你實現的功能也就是

要刪除資料(在後台處理)和返回頁面(用前台指令碼),給你換個思路,這樣寫邏輯也清除點。

有個伺服器按鈕button1,

一。首先在page_load中給伺服器按鈕註冊個前台事件

//控制項執行點選事件原理:當你點選button1的時候,如果按鈕有前台事件,是先會執行前台事件,然後再執行相對應的後台事件,

//deletedata就是前台的指令碼函式

button1.attributes.add("onclick","deletedata()");

二。在前台頁面head區域加上deletedata這個前台方法

")改為

page.registerclientscriptblock("message","")(vs2003寫法,2005以上有新方法),這樣指令碼才會同步,不然response會導致頁面呈現白色。

好了說了這麼多,你應該對這方便原理了解了。請參考

asp的if語句一般怎麼用?說詳細點

3樓:匿名使用者

1. if..end if

<%dim mynum:mynum = 8

if mynum = 8 then

response.write("你輸入正確!")end if

%>2.if...else...end if

<%dim mynum:mynum = 10

if mynum = 10 then

response.write("你輸入正確!")else

response.write("你輸入錯誤!")end if

%>3.if...elseif...else...end if<%

dim mynum:mynum = 10

if mynum > 10 then

response.write("大於10")elseif mynum = 10 thenresponse.write("等於10")else

response.write("小於10")end if

%>4.巢狀使用

<%dim mynum:mynum = 10

if mynum>=0 then

if mynum=0 then

執行語句1

else

執行語句2

end if

else

執行語句3

end if

%>

4樓:匿名使用者

案例:<%

a=1if a=1 then

response.write "正確"

else

response.write "錯誤"

end if

%>if ***是否成立 then

執行語句

else(否則)

執行另外一種語句

end if

可巢狀使用

if a>0 then

if a=1 then

執行語句1

else

執行語句2

end if

else

執行語句3

end if

asp 裡面多次用if 語句判斷怎麼寫呢?

5樓:

可以if hd=134 then

response.write"移動"

elseif hd=130 then

response.write"聯通"

elseif hd=189 then

response.write"電信"

end if

條件,自己補充,,,如果134這些數字不是數字,那用雙引號引上,,用做字串對比。。

意思是如果 條件 就

否則再如果 條件 就

否則再如果 條件就

否則結束如果。

6樓:育知同創教育

1. if..end if

<%dim mynum:mynum = 8

if mynum = 8 then

response.write("你輸入正確!")end if

%>2.if...else...end if

<%dim mynum:mynum = 10

if mynum = 10 then

response.write("你輸入正確!")else

response.write("你輸入錯誤!")end if

%>3.if...elseif...else...end if<%

dim mynum:mynum = 10

if mynum > 10 then

response.write("大於10")elseif mynum = 10 thenresponse.write("等於10")else

response.write("小於10")end if

%>4.巢狀使用

<%dim mynum:mynum = 10

if mynum>=0 then

if mynum=0 then

執行語句1

else

執行語句2

end if

else

執行語句3

end if

%>

求教asp中if語句的格式

7樓:匿名使用者

不對,看你的意思,應該是想寫成

if pic="16" then response.write ""

elseif pic="24" then response.write ""

elseif pic="25" then response.write ""

else response.write ""

end if

如果之前你寫的,若pic=16,會執行response.write "" 和 response.write ""兩條

而且你有三個if只有乙個end if 程式都無法正常的執行…………

8樓:牌牌網

錯誤的正確應該是這樣

<%dim pic

pic=request.querystring("bigclassid")

if pic="16" then response.write "" else

if pic="24" then response.write "" else

if pic="25" then response.write ""

else response.write ""

end if%>

關於asp的for迴圈中巢狀if語句的問題

9樓:sql的藝術

一般只用判斷分割後的陣列內是否為空

hire_workadd = ""

pstring=split(trim(request("workadd")),",")

for numm=0 to ubound(pstring)if len(pstring(numm))>0 then你的處理**....

end if

next

asp限制對頁面的訪問,asp限制對頁面的訪問

你好,給你個思路,你 看看。在1.asp裡重新整理的時候就獲取乙個隨機值,並把它寫入cookies或者session,然後在設定給隱藏域,點選提交的時候把這個隱藏域提交了,在2.asp裡判斷傳過來的隱藏域是否等於cookies或者session裡的值,如果等於則說明通過,並把cookies或者ses...

asp按鈕跳轉頁面並傳值,asp寫出 頁面跳轉和傳值 的關鍵語句

你可以 在按鈕上寫 個 js 跳轉的 onclick 就跳轉 在要跳轉的位址後加 引數 值 另乙個頁面 request.querystring 獲取值呀 在button的單擊事件裡 response.write asp寫出 頁面跳轉和傳值 的關鍵語句 比如 string s url response...

asp頁面如何顯示時間,asp怎麼顯示當前年月日

asp中有固定的內建函式定義當前時間 獲取當前系統日期和時間,asp輸出可以這樣寫 now 獲取年份,asp輸出 year now 獲取當前月份,asp輸出 month now 獲取當天數,asp輸出 day now 獲取分鐘數,asp輸出 minute now 獲取秒鐘數,asp輸出 second...

菜鳥求救製作asp查詢頁面

乙個檔案就行了,資料庫連線什麼的我就不寫了,搜尋下,多的是這裡寫下sql命令 dim keyword keyword request.form keyword dim sqlstr 你的資料表結構不清晰,這個是按一般情況寫的,是否兩個表內容一致或者結構相同?是否查出的資料是單獨 於乙個表或者是兩個表...

asp登入驗證頁面怎麼跟登入頁面建立聯絡

既然是做校驗首先要了解你做這個東西的目的 目的 實現賬號密碼的驗證。安全 為了防止賬戶被暴力破解,我們應該加入驗證碼字段,這樣可有效的防止機械人暴力破解。分析登陸頁 登陸就應該有登陸的輸入框,密碼的輸入框,驗證碼 可有可無 表單,按鈕控制項等等。分析驗證頁 鏈結資料庫,建立使用者表資料集,sql獲取...