- Fixed MR-84
[castle.git] / MonoRail / TestSite / views / registration / postback.aspx.cs
blob7ead9ab2396b390b5ca82fea9f2596173eb269e5
1 using System;
2 using System.Collections;
3 using System.ComponentModel;
4 using System.Data;
5 using System.Drawing;
6 using System.Web;
7 using System.Web.SessionState;
8 using System.Web.UI;
9 using System.Web.UI.WebControls;
10 using System.Web.UI.HtmlControls;
11 using Castle.MonoRail.Framework;
13 namespace TestSite.views.registration
15 /// <summary>
16 /// Summary description for postback.
17 /// </summary>
18 public class postback : System.Web.UI.Page, IControllerAware
20 protected System.Web.UI.WebControls.Button Save;
21 protected System.Web.UI.WebControls.Label postCount;
22 private Controller _controller;
24 protected int PostCount
26 get
28 if (!_controller.PropertyBag.Contains("postCount"))
30 _controller.PropertyBag["postCount"] = 0;
33 return (int) _controller.PropertyBag["postCount"];
37 private void Page_Load(object sender, System.EventArgs e)
41 #region Web Form Designer generated code
42 override protected void OnInit(EventArgs e)
45 // CODEGEN: This call is required by the ASP.NET Web Form Designer.
47 InitializeComponent();
48 base.OnInit(e);
51 /// <summary>
52 /// Required method for Designer support - do not modify
53 /// the contents of this method with the code editor.
54 /// </summary>
55 private void InitializeComponent()
57 this.Load += new System.EventHandler(this.Page_Load);
60 #endregion
62 public void SetController(Controller controller)
64 _controller = controller;
67 public void DoAPostBack(object sender, EventArgs args)
69 // Validation
70 // Work work work...
71 // Ok, proceed
73 _controller.Send( "DoAPostBack" );
75 postCount.Text = PostCount.ToString();