# How can I make my webform behave differently depending on the current action in the workflow?

**URL:** <https://discuss.workflowgen.com/t/how-can-i-make-my-webform-behave-differently-depending-on-the-current-action-in-the-workflow/156>\
**Category:** Visual Studio Web Forms\
**Created:** [March 3, 2008, 6:55am UTC](https://discuss.workflowgen.com/t/how-can-i-make-my-webform-behave-differently-depending-on-the-current-action-in-the-workflow/156 "2008-03-03T06:55:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wfg-admin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/wfg-admin/32/714_2.png) [@wfg-admin](https://discuss.workflowgen.com/u/wfg-admin)\
**Post date:** [March 3, 2008, 6:55am UTC](https://discuss.workflowgen.com/t/how-can-i-make-my-webform-behave-differently-depending-on-the-current-action-in-the-workflow/156/1 "2008-03-03T06:55:12Z")

</div>

If you would like to control the way that a web form acts conditionally depending on the current action in WorkflowGen, add the following code to your project:

#### C#

```auto
protectedvoidPage_Load(objectsender,EventArgse){switch(this.CurrentWorkflowActionName){caseINITIATES://writecodeherebreak;caseSECOND_ACTION://write code herebreak;}}

```

#### VB

```auto
ProtectedSubPage_Load(ByValsenderAsObject,ByValeAsEventArgs)SelectCase(Me.CurrentWorkflowActionName)CaseINITIATES'writecodehereCaseSECOND_ACTION'writecodehereEndSelectEndSub

```
