SPRNET-843 - second attempt at solution templates, now conforming to project layout expected by Solution Factory add-in!

This commit is contained in:
markpollack
2009-07-31 18:31:22 +00:00
parent acaab749d6
commit 0ba232a918
64 changed files with 2868 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
<%@ Page Language="C#" EnableViewState="false" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="DI_HelloWorld_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title><%=Title%></title>
</head>
<body>
<h2><a href="../../Default.aspx">Welcome to Spring.NET Web Framework Quick Start Application Template</a></h2>
<h2><a href="../Default.aspx">Dependency Injection</a></h2>
<div>
<h2>Hello World example</h2>
<form id="form1" runat="server">
<p>
This very simple web form demonstrates dependency injection on pages and controls.
</p>
<p>
The message you can see below has been injected by &lt;object type="Default.aspx"&gt; object definition:
</p>
<p>
'<%=Message%>'
</p>
</form>
</div>
</body>
</html>

View File

@@ -0,0 +1,30 @@
using System;
using System.Web.UI;
/// <summary>
/// Notice that you don't need to extend Spring.Web.UI.Page for DI features!
/// </summary>
public partial class DI_HelloWorld_Default : System.Web.UI.Page
{
private string message;
public string Message
{
get { return this.message; }
set { this.message = value; }
}
/// <summary>
/// Values are injected right before OnInit() is called.
/// </summary>
/// <param name="e"></param>
protected override void OnInit(EventArgs e)
{
if(this.Message == null)
{
throw new ArgumentNullException("Message");
}
base.OnInit(e);
}
}

View File

@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<configuration>
<spring>
<context>
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net">
<!-- use the filename of your Page for the 'type' attribute to configure DI for a Page -->
<object type="Default.aspx">
<property name="Title" value="Dependency Injection - Hello World Sample"/>
<property name="Message">
<value>This message you are reading was set using dependencies injection.</value>
</property>
</object>
</objects>
</spring>
<system.web>
</system.web>
</configuration>