Hi @kevin.lee,
Yeah, I’m using the FormDesigner.
I do have override the WorkflowGen page validation:
protected override void OnPreLoad(EventArgs e)
{
IsSessionLess = true;
HandleSubmitButton = false;
submitButton.Click += new EventHandler(testSubmitButton_Click);
submitButton.ValidationGroup = "WFGENPage";
base.OnPreLoad(e);
}
But the problem is when I using the code below, the alert box did not show up at all after click the submit button.
protected void testSubmitButton_Click(object sender, EventArgs e)
{
if(condition == 1)
{
ScriptManager.RegisterStartupScript(this, GetType(), "a1", "alert('Condition 1!!!');", true);
}
else if(condition == 2)
{
ScriptManager.RegisterStartupScript(this, GetType(), "a1", "alert('Condition 2!!!');", true);
}
this.SaveFormData(this.FormData, true);
SubmitToWorkflow();
}
If I remove the “SubmitToWorkflow();” code, the alert box is able to display after click the submit button.
protected void testSubmitButton_Click(object sender, EventArgs e)
{
if(condition == 1)
{
ScriptManager.RegisterStartupScript(this, GetType(), "a1", "alert('Condition 1!!!');", true);
}
else if(condition == 2)
{
ScriptManager.RegisterStartupScript(this, GetType(), "a1", "alert('Condition 2!!!');", true);
}
this.SaveFormData(this.FormData, true);
// SubmitToWorkflow();
}
I would like to know if there any possible method to solve the problem above.