繁体中文
设为首页
加入收藏
当前位置:ASP技术首页 >> ASP应用 >> 【原创】ASP开发技巧集锦二

【原创】ASP开发技巧集锦二

2005-10-23 10:34:08  作者:caoxicao  来源:互联网  浏览次数:242  文字大小:【】【】【
简介:11. 报错并返回if rs.bof and rs.eof then  ‘还是有问题response.write"<SCRIPT language=JavaScript>alert('找不到!');"response.write"javascript:history.go(-1)</SCRIP...
关键字:集锦 技巧 开发 ASP

11. 报错并返回if rs.bof and rs.eof then ‘还是有问题

response.write""

end if

-----------------------------------

这个是跳转。

12. 从VBS到JS,混用 <%

dim checkpwdconfig

checkpwdconfig=split(addation,"/")

%>

13. 弹出窗口用一个连接调用:

请修改密码 onClick="openaddnew()"图片调用:

.gif" onClick="openaddnew()">14. 分页

<%

if request("pageno")<>"" then

pageno=int(request("pageno"))

else

pageno=1

end ifsql="select * from news where [language]='中文' and bigclassname='新闻' order by id desc"

Set rs= Server.CreateObject("ADODB.Recordset")

rs.open sql,conn,1,3

rs.pagesize=20

if rs.eof then

pageno=0

else

rs.absolutepage=pageno

end if

%>

==========================================

共<%=rs.recordcount%>条,<%=pageno%>/<%=int(rs.pagecount)%>页,每页<%=rs.pagesize%>条

首页

<%if pageno>1 then%>

上一页

<%

end if

if int(pageno)<>int(rs.pagecount)then

%>

下一页

<%end if%>

尾页

<%rs.close%>

<%call CloseConn()

%>15. 数据库更新 sql="select * from [user] where username='"&request("username")&"'"

rs.Open sql,Conn,1,3

rs("usermail")=Request("usermail")

rs("userhome")=Request("userhome"))

rs.update

rs.close16. 关闭独立窗口

17. 极细表格

 
18. 几个正则表达式Require : /.+/,

Email : /^\w+([-+.]\w+)*@\w+([-.]\\w+)*\.\w+([-.]\w+)*$/,

Phone : /^((\(\d{3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}$/,

Mobile : /^((\(\d{3}\))|(\d{3}\-))?13\d{9}$/,

Url : /^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\'NULL!]*([^<>\"\"])*$/,

IdCard NULL^\d{15}(\d{2}[A-Za-z0-9])?$/,

Currency NULL^\d+(\.\d+)?$/,

Number NULL^\d+$/,

Zip NULL^[1-9]\d{5}$/,

QQ NULL^[1-9]\d{4,8}$/,

Integer NULL^[-\+]?\d+$/,

Double NULL^[-\+]?\d+(\.\d+)?$/,

English NULL^[A-Za-z]+$/,

Chinese NULLnbsp; /^[\u0391-\uFFE5]+$/,

UnSafe NULL^(([A-Z]*|[a-z]*|\d*|[-_\~!@#\$%\^&\*\.\(\)\[\]\{\}<>\?\\\/\'\"]*)|.{0,5})$|\s/,19. Left应用(控制字数)function title(str)

if len(trim(str))>=28 then

title=left(trim(str),27)&"..."

else

title=trim(str)

end if

end function 20. 判断浏览器

责任编辑:admin
相关文章