|
using System;
namespace DateSite
{
/// <summary>
/// Control to skip to different states within the navigational workflow and
/// to illustrate how to redirect to an error page from the UI using the
/// navigational workflow.
/// </summary>
public partial class NavigationPane : System.Web.UI.UserControl
{
private WorkflowManager _workflowManager;
/// <summary>
/// Page load code.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
// create an instance of the navigational workflow manager
_workflowManager = new WorkflowManager(Application, Session, Request, Response);
}
/// <summary>
/// Skips to basics.aspx page if possible (else will redirect to genericError.aspx).
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lnkBasics_Click(object sender, EventArgs e)
{
string pageToGoTo = _workflowManager.SkipToBasics();
_workflowManager.ManagedRedirect(pageToGoTo);
}
/// <summary>
/// Skips to appearance.aspx page if possible (else will redirect to genericError.aspx).
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lnkAppearance_Click(object sender, EventArgs e)
{
string pageToGoTo = _workflowManager.SkipToAppearance();
_workflowManager.ManagedRedirect(pageToGoTo);
}
/// <summary>
/// Skips to lifestyle.aspx page if possible (else will redirect to genericError.aspx).
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lnkLifestyle_Click(object sender, EventArgs e)
{
string pageToGoTo = _workflowManager.SkipToLifestyle();
_workflowManager.ManagedRedirect(pageToGoTo);
}
/// <summary>
/// Skips to interests.aspx page if possible (else will redirect to genericError.aspx).
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lnkInterests_Click(object sender, EventArgs e)
{
string pageToGoTo = _workflowManager.SkipToInterests();
_workflowManager.ManagedRedirect(pageToGoTo);
}
/// <summary>
/// Skips to complete.aspx page if possible (else will redirect to genericError.aspx).
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lnkComplete_Click(object sender, EventArgs e)
{
string pageToGoTo = _workflowManager.SkipToComplete();
_workflowManager.ManagedRedirect(pageToGoTo);
}
/// <summary>
/// Skips to the default.aspx page to allow user to create/retrieve/delete
/// profiles and navigational workflows.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lnkNewWorkflow_Click(object sender, EventArgs e)
{
string pageToGoTo = _workflowManager.GetStartPage();
_workflowManager.ManagedRedirect(pageToGoTo);
}
/// <summary>
/// Illustrates how to navigate to an error page from the UI.
/// Navigates to unknownError.aspx.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void lnkGenerateUnknownError_Click(object sender, EventArgs e)
{
string pageToGoTo = _workflowManager.Error(DateSiteNavigation.ErrorType.Unknown);
_workflowManager.ManagedRedirect(pageToGoTo);
}
}
}
|
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.