|  | 
 
| popasp_inc.asp 
 
 复制代码<!--#include file="../popasp_2.0/popasp.asp"-->
<%
const APP_PATH = "home2"
'在多文件简化引入框架时,必须显示地声明框架路径
'框架路径与include是一致的
POP_MVC.mvc_dir = "../popasp_2.0/"
POP_MVC.run
%>
 IndexAction.class.asp
 
 复制代码<%
' 本类由系统自动生成,仅供测试用途
Class IndexAction
    public Sub index()
                on error resume next
                dim rs , range
                '通过数据模型从数据库中取出一条记录
                'set rs = M_("post").db.where(5).field("id,title").find()                
                'var_export rs
                
                set rs = M_("post").page( array(null,10) ).field("id,title,add_time").select()        
                that.assign "page",P_("PAGE")(rs).show()
                
                that.assign "list",array(rs)
                
                'L_方法是记录错误用的,它是Log首字母的简写s
                call L_("IndexAction.Index")
    end Sub
        
        public sub post
                dim id
                
                'that.get是request.querystring的一种简写
                id = that.get("id")
                
                set rs = M_("post").db.field("id,title,add_time,content").where(id).find()
                
                that.assign "row",rs
                
                var_export M_("post")
        end sub
End Class
%>
 | 
 |