asp+與asp的區別(6)

來源:互聯網
上載者:User
伺服器端的ASP+代碼
作 者 : 青苹果電腦工作室 本文點擊次數:2733
要在頁面上顯示值,我們使用與早先的ASP 例子中相同的代碼:
...
If Len(Request.Form("selOpSys")) 〉 0 Then
strOpSys = Request.Form("selOpSys")
strName = Request.Form("txtName")
Response.Write("You selected '" & strOpSys _
& "' for machine '" & strName & "'.")
End If
...
但是ASP+ 和伺服器控制的一個很大的特色是正在伺服器上運行併產生頁面輸出的代碼都可以
使用它們。ASP+解釋程式強調都要有唯一的id 屬性,這樣所有的伺服器控制(例如那些有
the runat="server" 屬性的元素)都可以被代碼重新使用。這就意味著我們不再使用Request 集合
來擷取從我們的表單控制郵遞迴伺服器的那些值。相反,可以直接使用它們唯一的id來引用它們:
...
If Len(selOpSys.value) 〉 0 Then
Response.Write("You selected '" & selOpSys.value _
& "' for machine '" & txtName.value & "'.")
End If

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.