WSS (Windows SharePoint Services) Workflow with ASPX Task Forms Tutorial – Part 1

26 11 2008

Dear readers,

This is one of the areas I really struggled in when I moved from creating SharePoint & InfoPath form based workflows to creating WSS workflows that use ASPX pages for task forms.

Because WSS does not include ‘Forms Services’, the technology which allows the use of InfoPath forms in a web browser, the only real solution is to create some aspx pages to use for the task forms.

While looking round on the net, I noticed there was a lack of any workflow tutorials for WSS so I have decided to create a four part tutorial. In this tutorial in we will create a simple workflow allowing us to explore the steps required to develop workflows for the WSS platform.

In Part 1 of the tutorial we will look at a simple workflow process and will set up our Visual Studio project and batch file. In Parts 2 and 3 we will code the solution and in Part 4 we will deploy the solution to WSS.

Before we start I’d like to point out some of the annoyances I have encountered with ASPX based workflows:

  • You cannot visually design the ASPX pages if you inherit from the SharePoint default and application.master pages, the best way to get around this is to design the pages in a separate Visual Studio project and then copy the code over.
  • Any task that contains different fields/metadata will need its own Content Type, this means if you have a large workflow you will have many Content Types.
  • When you create a task using a ‘CreatetaskwithContentType’ activity it does not associate the Content Type to the Task list for you, you will need to run some code before the activity to add the Content Type at runtime.

Other than the above, I cannot find much more to complain about :p.

So, let’s imagine that we need to create a workflow to mimic the process below:


As you can see this is a fairly simple approval process, we can add a number of log activities throughout the workflow to enhance it further.

As you probably already know, there are two types of SharePoint/WSS Workflow – Sequential or State Machine.

  • Sequential – These are workflows that progress in a flowchart style nature and cannot go back in the process.
  • State Machine – These workflows progress from ‘State’ to ‘State’ and can go back at anytime in workflow. There is greater flexibility.

We will use State Machine for this tutorial as when the item is rejected, we need to go back to the previous task. We now need to configure Visual Studio, I will use Visual Studio 2008 for this tutorial, however you can use 2005 if needed.

Begin by creating a blank C# State Machine Library Project in Visual Studio:


Configure the solution explorer like the below example by adding the relevant folders, this will help us when we come to deploy our workflow to WSS.

In addition rename the Worklow1 class to something more meaningful and strongly sign the assembly to create an .snk file by using the Project > Signing dialog box.


We will use the Features directory to store the feature files, Images for any custom images we might add and the Layouts to store our ASPX forms.

This is the end of Part 1, stay tuned for Part 2 within the next few days!!




10 responses

8 01 2009

Can you please at a link from part 1 to other parts as there is no way of moving to next part.

9 01 2009

Hi Sean,

I’m afraid there is no Part 2 yet, I haven’t got round to creating it, I will probably post it here early next week. When I do, I will add a link here to the new part.



18 02 2009

Awesome article so far! Have you had the time to put togther part II. I can’t wait to read it.

15 09 2009

When are you going to publish the other parts of this?

2 11 2009

Part 2 done yet?

2 11 2009

Craig i’m afraid it’s not done yet, however I know this is one of the most viewed blog posts on here so I probably need to get it done asap.

I will try to do parts 2 and 3 one evening this week.

8 03 2010

So, where the other parts of this awesome article ever published? I’m really hungry for that info

9 03 2010

Hi Clement,

I’m afraid the other parts weren’t published – I had planned to but never got round to it. I’ll do my best to publish part 2/3 soon if I can.



17 03 2010

Hi Clement,

I’m afraid the other parts were not published. I keep reminding myself that I must get this done as this is the most popular post on my blog!



29 09 2010

So any news on getting the other parts done?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: