I Created a list definition & list instance for Sharepoint2010 in Visual Studio (C#). Also created Application page, that by default stores in layouts folder. My goal is to make that page as new form of my list.
As I understood, It should be done in that part of list schema:
<Forms>
<Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
<Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" />
</Forms>
I Tryed:
1) Add <New>_layouts/PIUVS/ProjectsNew.aspx</New> in <forms> tag. => then nothing happends
2) Change SetupPath to “_layouts/PIUVS/ProjectsNew.aspx” => while deploying appears error: Error occurred in deployment step ‘Activate Features’: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
P.S. I don’t use SP Designer or programs like that.
Found a solution.
This should be done not exactly in schema file.
To add custom form to list in Sharepoint2010 you should modify a content type. In
<ContentType>tag add following:Also copy this in ContentType reference in list’s schema.