I have created 'myUI.aspx' file @ /_layouts/myproject/myUI.aspx. This application page(aka LayoutPageBase) is used as a dialog across the farm just for creating new items in my list. As such I would also like to set it as the template for adding list items.

My custom list has a schema defenition where at the bottom I find

           <Form Type='DisplayForm' Url='DisplayForm.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' />

Both the List definition & the layout file are in the same solution.

I have tried changing NewForm to each of the below:

  <Form Type='NewForm' Url='NewForm.aspx' SetupPath='_layouts\myproject\myUI.aspx' WebPartZoneID='Main' /> 

  <Form Type='NewForm' Url='NewForm.aspx' Path='_layouts\myproject\myUI.aspx' WebPartZoneID='Main' /> 

  <Form Type='NewForm' Url='NewForm.aspx' Path='layouts\myproject\myUI.aspx' WebPartZoneID='Main' /> 

Is there a way to do this or am I using the wrong kind of .aspx file?

  • Try <Form Type='NewForm' Url='_layouts\myproject\myUI.aspx' – Amal Hashim Nov 21 '14 at 16:18
  • I tried this before. It looks like the url attribute should only contains the file name, which the list form will get. Entering a path results in error Error occurred in deployment step 'Activate Features': The file or folder name contains characters that are not permitted. Please use a different name. – Fensterbank Nov 26 '14 at 13:29
  • so how did you manage to set it for creating new items? did you try to create a new list from that shema, maybe the existing list doesn't get the upgrade ? – Gwny Nov 26 '14 at 14:20

After analyse the trace logs, I found the solution (for my case).

The content of attribute Path is relative to the installation path of the feature, e.g.

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\FEATURES\myproject\MyListInstanceName\

The content of attribute Path is relative to the template path, e.g.

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\

So with

 <Form Type='NewForm' Url='NewForm.aspx' Path='_layouts\myproject\myUI.aspx' WebPartZoneID='Main' /> 

Sharepoint tried to load the file C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\_layouts\myproject\myUI.aspx which does not exist.

So the solution for your code is:

    <Form Type='DisplayForm' Url='DisplayForm.aspx' Path='LAYOUTS\myproject\myUI.aspx' WebPartZoneID='Main' />
    <Form Type='EditForm' Url='EditForm.aspx' Path='LAYOUTS\myproject\myUI.aspx' WebPartZoneID='Main' />
    <Form Type='NewForm' Url='NewForm.aspx' Path='LAYOUTS\myproject\myUI.aspx' WebPartZoneID='Main' />

This means your last try must have been worked!

What was your error message? Did you look to the TraceLog, which file SharePoint tries to load?

| improve this answer | |

have you tried using 15 hive in path?

<Form Type='NewForm' Url='NewForm.aspx' Path='_layouts\15\myproject\myUI.aspx' WebPartZoneID='Main' /> 
| improve this answer | |
  • Yep, I tried it. This did not solved the problem. – Fensterbank Nov 26 '14 at 14:07

look at these links which explain how to do this:



these applications are in SharePoint 2010 but works in SharePoint 2013, I tried it and it works.

I hope you find it useful.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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