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";
Web.AllowUnsafeUpdates = false;

However, my form is not showing as expected, When I click on the list item, I am redirected to this page:


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)



  • 1
    It is not clear what you are asking. Your code seems to be about a workflow form. Your question starts with a statement about a content type form. The first link is about using a form for two different SP lists. The second link is full of comments asking how to implement this and stating that it does not work. So, what exactly do you want to achieve? Please step back. Describe the functional spec, without getting into details about forms or pages. What does your solution need to do?
    – teylyn
    Commented Jan 9, 2014 at 7:55
  • I will update my question, thanks teylyn, looking to your help
    – Wint
    Commented Jan 9, 2014 at 7:59

1 Answer 1


It turns out to be my fault. I was using absolute url for the DisplayFormUrl property, when I changed it to relative url (/_layout/WorkflowTaskForm.aspx), everything works just fine. (so the code snippet in my question works)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.