asp基础2012

asp的打印
<p><%=rs("name")%></p>
response.Write rs("name")

Response.Write "英雄<b>"&rs("name")&"</b><br>" 


单选框选中

<input name="xingbie" type="radio" id="radio" value="男" <% if rs("xingbie")="男" then %> checked="checked" <%end if%> />
      男
<input type="radio" name="xingbie" id="radio2" value="女" <% if rs("xingbie")="女" then %> checked="checked" <%end if%>  /> 
      女

解析文本域里的html

<%=Server.HTMLEncode(rs("content"))%>

选择前几个字

<%
Dim MyString, LeftString
MyString = rs("content")
LeftString = Left(MyString, 12)
%>
<td><%=LeftString%></td>

选择数据库里的东西

set rs=server.createobject("adodb.recordset")
sql="select * from biao where neirong="&c
rs.open sql,conn,1,1

where id="&mmm&"
where admin='"&session("name")&"'"

<%
set rs=server.CreateObject("adodb.recordset")
sql="select * from zhaopin"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
response.Write("暂无")
else
do while not rs.eof 
 %>	 
<%
rs.movenext
loop
end if
rs.close
set rs=nothing

%>

一行蓝色一行白色

dim t
t=0
if t mod 2 =0 then
response.Write "</tr><tr bgcolor=""#FF0000"">"
  else
  response.Write "</tr><tr>"
  end if
t=t+1

遇到utf-8的页面时怕乱码就

<% Response.Charset = "utf-8" %>
<%Session.CodePage=65001%> 



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值