Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I createad an application page and put it under /_layouts/, in the list definition I specified the edit form like so:

<FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
   <Edit>/_layouts/myform.aspx</Edit>
</FormUrls>

This updated the edit form to my application page when I had set Deployment Conflict Resolution: Auto on my list which deleted the list and recreated it.

I now have data in the same list in a different farm and I have to set Deployment Conflict Resolution to None. When I deployed this to the other farm the list kept is default edit form and I figured I have to change the form pro grammatically.

I created a feature with a feature receiver and added some code:

public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
    SPSite site = (SPSite)properties.Feature.Parent;
    var rootWeb = site.RootWeb;
    var myList = Utility.GetRootListByName("myList");
    myList.DefaultEditFormUrl = "/_layouts/myform.aspx";
    taskList.Update();
}

However with this code I get Activate Features': Unable to find an SPForm matching URL /_layouts/myform.aspx

Should I be able to use an application page as edit form? I mean it works fine when I deploy the list definition for the first time.

Thanks in advance.

share|improve this question

1 Answer 1

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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