Hi Osee,
In your project, add a InitiationForm item, then in page_load event, add the code as below to determine if the workflow is running.
protected void Page_Load(object sender, EventArgs e)
{
InitializeParams();
// Optionally, add code here to pre-populate your form fields.
foreach (SPWorkflow workflow in workflowListItem.Workflows)
{
//Determine if the workflow called "ApprovalWF" is running.
if (workflow.ParentAssociation.Name == "ApprovalWF" && workflow.InternalState == SPWorkflowState.Running)
{
TextBox1.Text = "RUNNING";
}
}
}
Thanks,
Simon
Simon Huang
TechNet Community Support
