ASP模拟MVC模型的编程方式(2)
作者:蔡晓亮 来源:网页教学网 发布时间:2008-10-15 14:51:00
adminusers_gl.asp代码如下:
<%
rem *****************通用网站管理系统***********************************
rem 页面功能:网站后台管理员添加修改表单
rem @author 蔡晓亮
rem @version 1.0
%>
<%
Response.Buffer=true
Response.Expires=0
%>
<!--#include file="../include/common.config.asp"-->
<!--#include file="../include/common.function.asp"-->
<!--#include file="../include/md5.asp"-->
<!--#include file="adminusers_class.asp"-->
<%
action=trim(replace(request("action"),"'",""))
Set GL = New AdminUsersGl '建立类的实例
%>
<%
if action="add" then
adminuser_name=trim(replace(request("adminuser_name"),"'",""))
adminuser_password=md5(trim(replace(request("adminuser_password"),"'","")),32)
admingroup_id=trim(replace(request("admingroup_id"),"'",""))
adminuser_realname=trim(replace(request("adminuser_realname"),"'",""))
adminuser_selfconfig=trim(replace(request("adminuser_selfconfig"),"'",""))
adminuser_isshow=trim(replace(request("adminuser_isshow"),"'",""))
adminuser_language=LANGUAGE
if adminuser_name<>"" then
GL.AdminUsers_Add adminuser_name,adminuser_password,admingroup_id,adminuser_realname,adminuser_selfconfig,adminuser_isshow,adminuser_language
end if
end if
if action="modi" then
adminuser_id=trim(replace(request("adminuser_id"),"'",""))
GL.AdminUsers_Xx adminuser_id
end if
if action="modideal" then
adminuser_id=trim(replace(request("adminuser_id"),"'",""))
adminuser_name=trim(replace(request("adminuser_name"),"'",""))
adminuser_password_n=trim(replace(request("adminuser_password_n"),"'",""))
adminuser_password_o=trim(replace(request("adminuser_password_o"),"'",""))
admingroup_id=trim(replace(request("admingroup_id"),"'",""))
adminuser_isshow=trim(replace(request("adminuser_isshow"),"'",""))
adminuser_selfconfig=trim(replace(request("adminuser_selfconfig"),"'",""))
adminuser_realname=trim(replace(request("adminuser_realname"),"'",""))
adminuser_language=LANGUAGE
if adminuser_id<>"" and adminuser_password_n<>"" then
adminuser_password_n=md5(adminuser_password_n,32)
'response.Write(adminuser_password_n)
GL.AdminUsers_Modideal adminuser_id,adminuser_name,adminuser_password_n,admingroup_id,adminuser_isshow,adminuser_selfconfig,adminuser_language,adminuser_realname
end if
if adminuser_id<>"" and adminuser_password_n="" then
'response.Write(adminuser_password_n&"cxl")
GL.AdminUsers_Modideal adminuser_id,adminuser_name,adminuser_password_o,admingroup_id,adminuser_isshow,adminuser_selfconfig,adminuser_language,adminuser_realname
end if
end if
if action="del" then
adminuser_id=trim(replace(request("adminuser_id"),"'",""))
GL.AdminUsers_Del adminuser_id
end if
%>
<%
title="管理员管理"
css="<link rel=stylesheet href=style/css/style.css type=text/css>"
body="<body topmargin=5 leftmargin=5 bgcolor=#555555>"
ShowHeadHtml title,LANGUAGE,css,body '调用公用函数产生头部代码
%>
<%if action="add" then%>
<table cellpadding="0" cellspacing="1" border="0" width="100%" class="border" align=center height="85">
<form name="form1" method="post" action="adminusers_gl.asp?action=add">
<tr>
<td height="50" colspan="2" align="center" bgcolor="#f1f1f1"><font class="title"><b><%=title%></b></font></td>
</tr>
<tr align="center">
<td width="23%" height="32" align="right" bgcolor="#f1f1f1"><strong>用户名 :</strong></td>
<td width="77%" align="left" bgcolor="#f1f1f1"> <input name="adminuser_name" type="text" size="40"></td>
</tr>
<tr align="center">
<td width="23%" height="32" align="right" bgcolor="#f1f1f1"><strong>密 码 :</strong></td>
<td width="77%" align="left" bgcolor="#f1f1f1"> <input name="adminuser_password" type="password" size="40"></td>
</tr>
<tr align="center">
<td width="23%" height="32" align="right" bgcolor="#f1f1f1"><strong>重复密码 :</strong></td>
<td width="77%" align="left" bgcolor="#f1f1f1"> <input name="adminuser_password2" type="password" size="40"></td>
</tr>
<tr align="center">
<td width="23%" height="32" align="right" bgcolor="#f1f1f1"><strong><span class="td1">是否有效</span> :</strong></td>
<td width="77%" align="left" bgcolor="#f1f1f1"> <input type="radio" value="Y" name="adminuser_isshow" checked>
是 <input type="radio" value="N" name="adminuser_isshow">否</td>
</tr>
<tr align="center">
<td width="23%" height="32" align="right" bgcolor="#f1f1f1"><strong>真实姓名 :</strong></td>
<td width="77%" align="left" bgcolor="#f1f1f1"> <input name="adminuser_realname" type="text" size="40"></td>
</tr>
<tr align="center">
<td width="23%" height="32" align="right" bgcolor="#f1f1f1"><strong>管理员组 :</strong></td>
<td width="77%" align="left" bgcolor="#f1f1f1">
<%
GL.Get_AdminGroups
%>
</td>
</tr>
<tr align="center">
<td width="23%" height="32" align="right" bgcolor="#f1f1f1"><strong>备 注 :</strong></td>
<td width="77%" align="left" bgcolor="#f1f1f1">
<textarea name="adminuser_selfconfig" cols="60" rows="10"></textarea></td>
</tr>
<tr align="center">
<td width="23%" height="32" align="right" bgcolor="#f1f1f1"> </td>
<td width="77%" align="left" bgcolor="#f1f1f1">
<input type="submit" name="submit" value="添加">
<input type="reset" name="reset" value="重置">
</td>
</tr>
</form>
</table>
<%end if%>
<%if action="modi" then%>
<table cellpadding="0" cellspacing="1" border="0" width="100%" class="border" align=center height="85">
<form name="form1" method="post" action="adminusers_gl.asp?action=modideal">
<tr>
<td height="50" colspan="2" align="center" bgcolor="#f1f1f1"><font class="title"><b><%=title%></b></font></td>
</tr>
<tr align="center">
<td width="23%" height="32" align="right" bgcolor="#f1f1f1"><strong>用户名 :</strong></td>
<td width="77%" align="left" bgcolor="#f1f1f1"> <input name="adminuser_id" type="hidden" value=<%=adminuser_id%>><input name="adminuser_name" type="text" size="40" value="<%=GL.AUName%>"></td>
</tr>
<tr align="center">
<td width="23%" height="32" align="right" bgcolor="#f1f1f1"><strong>新 密 码 :</strong></td>
<td width="77%" align="left" bgcolor="#f1f1f1"> <input name="adminuser_password_n" type="password" size="40"><input name="adminuser_password_o" type="hidden" value="<%=GL.AUPassword%>"></td>
</tr>
<tr align="center">
<td width="23%" height="32" align="right" bgcolor="#f1f1f1"><strong>重复新密码 :</strong></td>
<td width="77%" align="left" bgcolor="#f1f1f1"> <input name="adminuser_password2_n" type="password" size="40"></td>
</tr>
<tr align="center">
<td width="23%" height="32" align="right" bgcolor="#f1f1f1"><strong><span class="td1">是否有效</span> :</strong></td>
<td width="77%" align="left" bgcolor="#f1f1f1"> <input type="radio" value="Y" name="adminuser_isshow" <%if GL.AUIsshow="Y" then%>checked<%end if%>>
是 <input type="radio" value="N" name="adminuser_isshow" <%if GL.AUIsshow="N" then%>checked<%end if%>>否</td>
</tr>
<tr align="center">
<td width="23%" height="32" align="right" bgcolor="#f1f1f1"><strong>真实姓名 :</strong></td>
<td width="77%" align="left" bgcolor="#f1f1f1"> <input name="adminuser_realname" type="text" size="40" value="<%=GL.AURealname%>"></td>
</tr>
<tr align="center">
<td width="23%" height="32" align="right" bgcolor="#f1f1f1"><strong>管理员组 :</strong></td>
<td width="77%" align="left" bgcolor="#f1f1f1">
<%
GL.Get_AdminGroups_S
%>
</td>
</tr>
<tr align="center">
<td width="23%" height="32" align="right" bgcolor="#f1f1f1"><strong>备 注 :</strong></td>
<td width="77%" align="left" bgcolor="#f1f1f1">
<textarea name="adminuser_selfconfig" cols="60" rows="10"><%=GL.AUSelfconfig%></textarea></td>
</tr>
<tr align="center">
<td width="23%" height="32" align="right" bgcolor="#f1f1f1"> </td>
<td width="77%" align="left" bgcolor="#f1f1f1">
<input type="submit" name="submit" value="添加">
<input type="reset" name="reset" value="重置">
</td>
</tr>
</form>
</table>
<%end if%>
<%
if action="list" then
%>
<table width="100%" align=center border="0" cellspacing="1" cellpadding="0">
<tr><td colspan=6></td></tr>
<tr bgcolor="#999999"><td align=right class=td1 width="27%" height="25">
<p align="center">名称</td>
<td width="30%" align=right class=td1><div align="center">所属组</div></td>
<td width="13%" align=right class=td1><div align="center">登陆次数</div></td>
<td width="10%" height="25" class=td2><div align="center">是否有效</div></td>
<td width="10%" class=td2><div align="center">修改</div></td>
<td width="10%" class=td2><div align="center">删除</div></td>
</tr>
<%
GL.AdminUsers_List
%>
<tr>
<td height="25" colspan="6" align=right bgcolor="#F1F1F1" class=td1> </td>
</tr>
</table>
<%end if%>
<%
Set GL = Nothing
%>
<%
ShowBottomHtml '调用公用函数产生尾部代码
%>
以上程序写的不是很好,但结构还是比较清晰的,在adminusers_gl.asp中分别对action进行判断,去调用类中的不同方法,在下面页面部分,尽量使ASP代码减少,这样美工就能很轻松的修改程序界面了!


猜你喜欢
- 这个可应用于所有浏览器中.<SCRIPT language=javascript>var leave=true; functio
- 前言SQL 语言无处不在。SQL 已经不仅仅是技术人员的专属技能了,似乎人人都会写SQL,就如同人人都是产品经理一样。如果你是做后台开发的,
- 介绍两个关键的CSS <style media="print">  
- 本文实例为大家分享了原生js实现波浪导航效果的具体代码,供大家参考,具体内容如下展示效果:源码展示:<!doctype html>
- 一、什么是"非构造函数"的继承?比如,现在有一个对象,叫做"中国人"。var Chinese = {
- objectobject 是 Python 为所有对象提供的父类,默认提供一些内置的属性、方法;可以使用 dir 方法查看新式类以 obje
- 看过一篇关于下载网页中图片的文章,它只能下载以http头的图片,我做了些改进,可以下载网页中的所有连接资源,并按照网页中的目录结构建立本地目
- Html:<!doctype html><html><head><meta charset=&qu
- 一、偏好资源的积累利用DreamWeaver 4制作网页会应用到许多各种类型的要素,比如色彩、图片、模板、脚本等。利用站点资源面板将这些东东
- 本文实例为大家分享了python3实现qq邮箱登陆并发送邮件功能的具体代码,供大家参考,具体内容如下基于selenium,使用chrome浏
- 1.安装插件步骤2.点击OK确认之后,提示IDE需要重启,选择重启:3.设置leetcode插件,用户名、密码:4.点击右下角的leetco
- 如果你经常使用python开发GUI程序的话,那么就知道,有时你需要很长时间来执行一个任务。当然,如果你使用命令行程序来做的话,你回非常惊讶
- 1、说明在使用selenium时,不可避免的会遇到一些异常情况,比如超时、没有找到节点的错误等等。一旦出现这样的错误,程序就不能再运行了。这
- 在传统的递归中,典型的模式是,你执行第一个递归调用,然后接着调用下一个递归来计算结果。这种方式中途你是得不到计算结果,知道所有的递归调用都返
- 在使用FCKeditor的时候,可能会碰到以下这个问题,就是在编辑器页面出错,提示为:找不到页面/fckeditor/editor/fcke
- 内置300余汉字点阵.纯ASP实现汉字验证码.不读数据库.多种属性自由调节,其中包括:生成的图片长和宽,字符数,背景显示效果(渐变,杂色,固
- 本文实例讲述了Python定时执行之Timer用法。分享给大家供大家参考。具体分析如下:java中Timer的作用亦是如此。python中的
- 一、框架菜单1.1 common模块1.2 其他二、Excel接口测试案例编写三、读取Excel测试封装(核心封装)excel_utils.
- 本文实例讲述了Python2比较当前图片跟图库哪个图片相似的方法。分享给大家供大家参考,具体如下:# -*- coding: utf-8 -
- 一、插件是什么?插件是遵循一定规范的应用程序接口编写出来的程序,而chrome插件则是运行在chrome浏览器上的小程序,能帮我们解决一下工