Blog - Robert Bogue [MVP]
Rob's Notebook
SharePoint Calendar
Thor Projects LLC - Welcome

Turning a GET into a POST for SPWorkflowManager.StartWorkflow()

Posted by Robert L. Bogue on Wednesday, 24 Jan 2007 01:50 | 1 Comments | Professional

I mentioned in a previous post that you must run StartWorkflow on a POST request and not a GET request but I didn’t have time then to figure out how to do this quickly in a web part…  Here’s how to do it…  In any WebControl (or anything that can be to the Page object) add the following line.

 this.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "post", "<SCRIPT Language=\"JavaScript\">\n<!--\ndocument.forms[0].submit();\n-->\n</SCRIPT> ", false);

This will cause the page to post back to itself once it’s loaded.  It’s a kluge, but it solves the issue

Comments

Tuesday, 25 Nov 2008 03:07 by rüya tabiri
Thank you...

Leave your own comment

Name

Url

Email

Comments