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

📄 producttypebase.asp

📁 网上购物源代码
💻 ASP
字号:
<%
	function TypeToSelect(nTypeId, szCtlName)
		dim strSQL
		dim rsType
		dim tempi
		dim nID, szName
		Response.Write	"<SELECT name =""" & szCtlName & """ ID=""Select1"">"
		Response.Write	"<option value = ""0"">All type</option>"
		
		strSQL = "SELECT * FROM ProductType WHERE SuperID = 0"
		set rsType = Server.CreateObject("ADODB.RecordSet")
		rsType.Open strSQL, conn, 2,1
		if rsType.EOF And rsType.BOF then
			'如果没有检索到产品类型
			Response.Write	"</SELECT>"
			rsType.Close()
			Set rsType = Nothing
			exit function
		else
			do while not rsType.eof 
				nID = rsType("id")
				szName = rsType("name")
				Response.Write "<option value = "& nID
				'如果当前的nID与传入的nTypeId相同,则选中它
				
				if CInt(nID) = CInt(nTypeId) then Response.Write " selected"
				Response.Write ">"
				Response.Write szName &"</option>"
				rsType.MoveNext
			loop
		end if
		Response.Write	"</SELECT>"
		rsType.Close()
		Set rsType = Nothing
		
	end function
%>	

⌨️ 快捷键说明

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