的控制类为Bar.Foo.Query, 此类为流程控制, Mavrice.NET 将自动
调用此类中的
Perform()方法,并根据此方法的返回结果,跳转到相关的View去,执行后继的逻辑。
-------------------------------------------------------------------------
----------
// Classname : Bar.Foo.Query.cs
using System;
namespace Bar.Foo
{
public class Query : ControllerProtected
{
public override string Perform()
{
if (loginSuccessBool)
return SUCCESS;
else
return ERROR;
}
}
}
-------------------------------------------------------------------------
----------
四,部分程序代码
<!--default.aspx-->
<%@ Page %>
<%
Context.Response.Redirect("welcome.m");
%>
<!--maverick.config-->
<?xml version="1.0"?>
<maverick version="2.0" default-view-type="document"
default-transform-type="document">
<views>
<view id="loginRequired" path="loginRequired.aspx">
<transform path="trimOutside.aspx"/>
</view>
<view id="loginFailed" path="loginFailed.aspx">
<transform path="trimOutside.aspx"/>
</view>
</views>
<commands>
<command name="welcome">
<view path="welcome.aspx">
<transform path="trimOutside.aspx"/>
</view>
</command>
<command name="signup">
</commands>
</maverick>
<!-- welcome.aspx-->
<%@ Page %>
<%
Context.Items.Add("title","Welcome");
%>
<p>
Welcome to the Friendbook example. This is a simple contact-list
application which demonstrates how to create a membership-based
website with Maverick.
</p>
<%
Context.Items.Add("dest","friends.m");
Context.Server.Execute("loginForm.aspx");
%>
<!--trimOutside.aspx-->
<%@ Page %>
<html>
<head>
<title> <%=Context.Items["title"]%> </title>
<link rel="stylesheet" href="stylesheet.css"
type="text/css" />
</head>
<body>
<table cellspacing="0" cellpadding="0" width="