Click here to Skip to main content
12,828,367 members (46,367 online)
Click here to Skip to main content
Articles » Web Development » ASP.NET » Howto » Downloads


46 bookmarked
Posted 11 Apr 2005

Adding a ProcessContext to ASP.NET

, 11 Apr 2005
A simple and reliable way to build context into a multi stage process in ASP.NET.
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace Base4.Web.UI.SimpleHazardApplication
	/// <summary>
	/// Summary description for WebForm1.
	/// </summary>
	public class ActionPlan : ProcessParticipantPage
		protected System.Web.UI.WebControls.Button btnSubmit;
		protected System.Web.UI.WebControls.Label lblDue;
		protected System.Web.UI.WebControls.TextBox txtDue;
		protected System.Web.UI.WebControls.Label lblPlan;
		protected System.Web.UI.WebControls.TextBox txtPlan;
		protected System.Web.UI.WebControls.Label lblMessage;
		protected System.Web.UI.WebControls.HyperLink createNew;
		protected System.Web.UI.WebControls.Label lblPageDescription;
		private void Page_Load(object sender, System.EventArgs e)
			// Put user code to initialize the page here

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
			this.btnSubmit.Click += new System.EventHandler(this.btnSubmit_Click);
			this.Load += new System.EventHandler(this.Page_Load);


		private void btnSubmit_Click(object sender, System.EventArgs e)
			string title = ProcessContext["title"] as string;
			string severity = ProcessContext["severity"] as string;
			string description = ProcessContext["description"] as string;
			string ideas = ProcessContext["ideas"] as string;
			string analysis = ProcessContext["analysis"] as string;
			string plan = this.txtPlan.Text;
			DateTime duedate = DateTime.Parse(this.txtDue.Text);
			this.txtDue.Enabled = false;
			this.txtPlan.Enabled = false;
			this.btnSubmit.Enabled = false;
			this.lblMessage.Visible = true;
			this.createNew.Visible = true;

		private void InsertInDB(
			string title,
			string severity,
			string description,
			string ideas,
			string analysis,
			string plan,
			DateTime due)
			System.Diagnostics.Debug.WriteLine(string.Format("Title:{0} Severity:{1} Description:{2}",title,severity,description));
			System.Diagnostics.Debug.WriteLine(string.Format("Ideas:{0} Analysis:{1} Plan:{2} Due:{3}",ideas,analysis,plan,due));

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Alex James
Web Developer
New Zealand New Zealand
My name is Alex James, a software architect and developer from Auckland, New Zealand. I have 10 years of business experience working on and managing IT projects. My team and I recently decided to open source Base4.NET: a very exciting tool for creating integrated business applications.

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170326.1 | Last Updated 11 Apr 2005
Article Copyright 2005 by Alex James
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid