» 首页 » 电脑_数码 » 编程 » ASP语言代码求助,急啊~~~~~~~~~

ASP语言代码求助,急啊~~~~~~~~~

<%If Trim(Session("customer_login"))<>"" Then%>
<a href="#" onClick="window.open('shopcar.asp?ppid=<%=rsx("goods_ID")%>','','menubar=no,toolbar=no,location=no,directories=no,status=no,width=606,height=325,left=100,top=100,scrollbars=no');">【定购】</a>
<%End If%>

我想给这个“定购”的按钮加个条件,就是当我的数据库内customer_state列表的用户信息为数字2的时候,点击“定购”会转到错误提示界面
问题补充:是customer_info表中的一列 customer_state


<%If Trim(Session("customer_login"))<>"" Then
if rsx("customer_state")<>2 then
%>
<a href="#" onClick="window.open('shopcar.asp?ppid=<%=rsx("goods_ID")%>','','menubar=no,toolbar=no,location=no,directories=no,status=no,width=606,height=325,left=100,top=100,scrollbars=no');">【定购】</a>
<%else%>
<a href="错误提示的地址">【定购】</a> <%End If
End If%>

<%If Trim(Session("customer_login"))<>"" Then
if rsx("customer_state")<>2 then
%>
<a href="#" onClick="window.open('shopcar.asp?ppid=<%=rsx("goods_ID")%>','','menubar=no,toolbar=no,location=no,directories=no,status=no,width=606,height=325,left=100,top=100,scrollbars=no');">【定购】</a>
<%else%>
<a href="错误提示的地址">【定购】</a> <%End If
End If%>

你也可以加一个IF判断.
<%
Sql="select customer_state from customer_info"
Set Rs=Conn.execute(Sql)
if Rs(0)=2 then
%>
<a href="Error.html" >【定购】</a>
<%
else
%>
<%If Trim(Session("customer_login"))<>"" Then%>
<a href="#" onClick="window.open('shopcar.asp?ppid=<%=rsx("goods_ID")%>','','menubar=no,toolbar=no,location=no,directories=no,status=no,width=606,height=325,left=100,top=100,scrollbars=no');">【定购】</a>
<%End If%>

参考资料:http://www.hong100.cn

 相关问题
·ASP语言代码求助,急啊~~~~~~~~~
·在ASP页面中如何实现ACCESS数据库URL链接
·美萍进销存好用吗?
·文本框的默认值怎么设为上一次输入的记录
·求助!在线等!怎么居中框架?
·有关程序员的若干问题!!!高分
·简便运算1+2-3-4+5+6-7-8+9+10-……+1990=?
·关于上传图片,将途经存入access数据库的问题
·matlab中多个输出参数如何显示???
·flash迷宫游戏
·帮忙写段代码,显示百度主页
·函数重载的问题
·怎样在EXCEL2007里面做函数输出不同的答案,字体颜色不一样
·求一道VF编程...我们的作业
·什么是开放性城市,它是怎么定义?

 《ASP语言代码求助,急啊~~~~~~~~~》答案收集时间:2008-06-14 14:37:44



©2007 电脑技术问答录