0

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!

2 Answers 2

2

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

1
  • also make sure its a layouts mapped folder and not just a layouts folder. Sep 28, 2012 at 16:16
0

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

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.