Skip to content

Commit

Permalink
Added new todo page and actions
Browse files Browse the repository at this point in the history
  • Loading branch information
chadmyers committed Jul 15, 2011
1 parent c3c19f6 commit d4c0fd9
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
22 changes: 22 additions & 0 deletions source/MyApplication/Actions/Todo/New.aspx
@@ -0,0 +1,22 @@
<%@ Page Language="C#" AutoEventWireup="true" Inherits="MyApplication.Actions.Todo.New" %>
<%@ Import Namespace="MyApplication.Actions.Todo" %>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>New Todo Page</title>
</head>
<body>
<%: this.FormFor(new CreateTodo()) %>
<%: this.Edit(m=>m.Todo.Title) %>
<br />
<%: this.Edit(m => m.Todo.Notes)%>
<br />
<%: this.Edit(m=>m.Todo.DueDateTime) %>
<br />
<%: this.Edit(m=>m.Todo.HighPriority) %>
<input type="submit" title="Submit" />
<%= this.EndForm() %>
</body>
</html>
28 changes: 28 additions & 0 deletions source/MyApplication/Actions/Todo/NewAction.cs
@@ -0,0 +1,28 @@
using FubuMVC.Core.Continuations;
using FubuMVC.WebForms;

namespace MyApplication.Actions.Todo
{
public class NewAction
{
public NewTodoOutput Get(NewTodo input)
{
return new NewTodoOutput{ Todo = new Todo()};
}

public FubuContinuation Post(CreateTodo input)
{
return FubuContinuation.RedirectTo(new ViewTodo());
}
}

public class NewTodo{}
public class NewTodoOutput
{
public Todo Todo { get; set; }
}
public class CreateTodo{}
public class ViewTodo{}

public class New : FubuPage<NewTodoOutput>{}
}
12 changes: 12 additions & 0 deletions source/MyApplication/Actions/Todo/Todo.cs
@@ -0,0 +1,12 @@
using System;

namespace MyApplication.Actions.Todo
{
public class Todo
{
public string Title { get; set; }
public string Notes { get; set; }
public DateTime DueDateTime { get; set; }
public bool HighPriority { get; set; }
}
}
5 changes: 5 additions & 0 deletions source/MyApplication/MyApplication.csproj
Expand Up @@ -80,10 +80,15 @@
</ItemGroup>
<ItemGroup>
<Content Include="Actions\Home\Home.aspx" />
<Content Include="Actions\Todo\New.aspx" />
<Content Include="Web.config" />
</ItemGroup>
<ItemGroup>
<Compile Include="Actions\ActionUrlPolicy.cs" />
<Compile Include="Actions\Todo\NewAction.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Actions\Todo\Todo.cs" />
<Compile Include="App_Start\FubuMVC.cs" />
<Compile Include="ConfigureFubuMVC.cs" />
<Compile Include="Actions\Home\HomeAction.cs">
Expand Down

0 comments on commit d4c0fd9

Please sign in to comment.