Click here to Skip to main content
15,867,568 members
Articles / Web Development / IIS

Adding a ProcessContext to ASP.NET

Rate me:
Please Sign up or sign in to vote.
4.82/5 (14 votes)
11 Apr 20058 min read 68.2K   545   46  
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 Analysis : ProcessParticipantPage
	{
		protected System.Web.UI.WebControls.TextBox txtAnalysis;
		protected System.Web.UI.WebControls.TextBox txtIdeas;
		protected System.Web.UI.WebControls.Label lblIdeas;
		protected System.Web.UI.WebControls.Label lblAnalysis;
		protected System.Web.UI.WebControls.Button btnNext;
		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.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    
			this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		private void btnNext_Click(object sender, System.EventArgs e)
		{
			string ideas = this.txtIdeas.Text;
			string analysis = this.txtAnalysis.Text;
			ProcessContext["ideas"] = ideas;
			ProcessContext["analysis"] = analysis;
			Response.Redirect(this.AttachProcessToUrl("ActionPlan.aspx"));

		}
	}
}

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.

License

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


Written By
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.

Comments and Discussions