-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Custom controls are not auto-registered to and resolved by Windsor Co…
…ntainer (#4)
- Loading branch information
Showing
13 changed files
with
140 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
<%@ Page Language="C#" AutoEventWireup="false" CodeBehind="Default.aspx.cs" Inherits="Havit.CastleWindsor.WebForms.Example.DefaultPage" %> | ||
<%@ Register Src="~/DemoControl.ascx" TagPrefix="havit" TagName="DemoControl" %> | ||
|
||
<html> | ||
<head> | ||
<title>Hello Havit.CastleWindsor.WebForms!</title> | ||
</head> | ||
<body> | ||
Demo 8: | ||
<asp:Literal ID="litHello" runat="server" /> | ||
<div>Demo1: <havit:DemoControl runat="server" /></div> | ||
<div>Demo2: <havit:DemoControl runat="server" /></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,10 @@ | ||
using System; | ||
using System.Linq; | ||
using System.Web.UI; | ||
|
||
namespace Havit.CastleWindsor.WebForms.Example | ||
{ | ||
public partial class DefaultPage : Page | ||
{ | ||
private readonly IMyDependecy myDependecy; | ||
|
||
public DefaultPage(IMyDependecy myDependecy) | ||
{ | ||
this.myDependecy = myDependecy; | ||
} | ||
|
||
protected override void OnLoad(EventArgs e) | ||
{ | ||
base.OnLoad(e); | ||
|
||
litHello.Text = myDependecy.MyMethod(); | ||
} | ||
} | ||
} | ||
} |
9 changes: 0 additions & 9 deletions
9
src/Havit.CastleWindsor.WebForms.Example/Default.aspx.designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DemoControl.ascx.cs" Inherits="Havit.CastleWindsor.WebForms.Example.DemoControl" %> | ||
<asp:Literal ID="DemoLiteral" runat="server" /> |
26 changes: 26 additions & 0 deletions
26
src/Havit.CastleWindsor.WebForms.Example/DemoControl.ascx.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
using System.Web.UI; | ||
using System.Web.UI.WebControls; | ||
|
||
namespace Havit.CastleWindsor.WebForms.Example | ||
{ | ||
public partial class DemoControl : System.Web.UI.UserControl | ||
{ | ||
private readonly IMyDependecy myDependecy; | ||
|
||
public DemoControl(IMyDependecy myDependecy) | ||
{ | ||
this.myDependecy = myDependecy; | ||
} | ||
|
||
protected override void OnLoad(EventArgs e) | ||
{ | ||
base.OnLoad(e); | ||
|
||
DemoLiteral.Text = myDependecy.SayHello(); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/Havit.CastleWindsor.WebForms.Example/DemoControl.ascx.designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
{ | ||
public interface IMyDependecy | ||
{ | ||
string MyMethod(); | ||
string SayHello(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters