I want to use a custom application page for my workflow task view/edit form, I searched the internet and find it is possible to set url for content type's edit/view form, my code to update task's form is this: (this question has nothing to do with Workflow however)
Web.AllowUnsafeUpdates = true;
var taskList = Web.Lists["Tasks"];
var wfContentType = taskList.ContentTypes["Workflow Task"];
wfContentType.DisplayFormUrl = "_layout/WorkflowTaskForm.aspx";
wfContentType.Update();
taskList.Update();
Web.AllowUnsafeUpdates = false;
However, my form is not showing as expected, When I click on the list item, I am redirected to this page:
mysite.com/_layouts/listform.aspx?PageType=4&ListId={0613FA06-BD63-42F1-820F-78106FD2B4F8}&ID=546&ContentTypeID=0x0108010065CBC91109B00342A1F22B241DF80C0D&Source=http%3A%2F%2Feric%2Fwf3%2FLists%2FTasks%2FAllItems%2Easpx
Seems other guys are successful with this method, I have no idea where I was wrong, could some one kindly help me? Thanks Very Much! I was referring to these resources:(use SPContentType.DisplayFormUrl to specify its form)
http://blog.qumsieh.ca/2009/05/15/how-to-change-the-default-editform-newform-and-dispform/