⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 servercontrol.0.asp

📁 ASP企业网络管理系统
💻 ASP
字号:
<%
class DBCombo
	private props,optsV,optsL
	public Name,Selected
	private sub class_initialize
	  props = ""
		optsV = null
	end sub
	private sub class_terminate
	  '
	end sub
	public property let Properties(sProp)
	  props = sProp
	end property
	public property get Properties()
	  Properties = props
	end property
	public sub setOptions(arrV,arrL)
	  optsV = arrV
	  optsL = arrL
	end sub
	public sub WriteHTML(sql,conn)
	  dim rstmptmp,i
  	set rstmp = Server.CreateObject("ADODB.RECORDSET")
  	rstmp.Open sql,conn 
  	Response.Write "<select id=""sel_" & Name & """ name=""" & Name & """ "
    Response.Write Properties & ">"
  	while not rstmp.EOF
  		if rstmp(0) = Selected then
  			Response.Write "<option value=""" & trim(rstmp(0)) & """ selected>" & trim(rstmp(1)) & "</option>"
  		else
  			Response.Write "<option value=""" & trim(rstmp(0)) & """>" & trim(rstmp(1)) & "</option>"
  		end if
  		rstmp.MoveNext
  	wend
    if not isnull(optsV) then
			for i = 0 to UBound(optsV)
				if optsV(i) = Selected then
					Response.Write "<option value=""" & optsV(i) & """ selected>" & optsL(i) & "</option>"
				else
					Response.Write "<option value=""" & optsV(i) & """>" & optsL(i) & "</option>"
				end if
			next
		end if
  	Response.Write "</select>"
  	rstmp.Close
  	set rstmp=nothing
	end sub
end class
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -