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'm creating a custom NewForm for a list (and will subsequently be doing EditForm and Display form), but I can't work out how to populate the Form attribute in the list definition's Schema.xml file.

This tutorial (I think) will just set the relative path at runtime, but this one, and several others, suggest something more complex that I can't really understand. Neither work.

Does anyone know how to set this up? Thanks!

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

What you can do is the following open up your schema xml document. Make sure you add a layouts folder to your solution. Add your aspx file there.

and within this tag make these changes from this -->

<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>

to this --->

<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="Layouts\{your list name}\{your new form}.aspx" WebPartZoneID="Main" />
</Forms>

do this for edit, display also.. run the project and you should see your new form. I know what you mean by the articles being complex.. Some people just like to take the hard route to make their self feel better guess it's a pride thing... Wish people can be straight forward...

share|improve this answer
    
also make sure its a layouts mapped folder and not just a layouts folder. –  Joseph D Surgeon Sep 28 '12 at 16:16
add comment

The best example would be to look into the 14-hive and get yourself inspired. Additionally, every time you use VS2010 to create a new list definition it will generate the basics for you (i guess you figure that already).

If you do not want a full list definition, go for creating one with SPD - simplest and most flexible, you can even add related web parts, change fields structures, etc.. You can then export the entire ASPX and deploy it as MODULE from Visual Studio solution to any existing list.

Hope it helps, C:\Marius

share|improve this answer
add comment

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.