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 am creating a custom list inside a feature receiver. I would like to create a custom New Form for my list.

So, the list is not created via List definition.

Can anyone guide me how to create the custom form in visual studio and attach it to the newly created list and set it as the default form?

Thank you for your help.

share|improve this question

migrated from stackoverflow.com Jun 30 '12 at 23:36

This question came from our site for professional and enthusiast programmers.

1 Answer 1

You can define a custom applicationpage object in your solution which can have the custom form you want for the list. Your custom list definition can point to that file (or those files) as appropriate for the view, new, or edit forms.

Within the Schema.xml file the paths are defined within the Forms group.

<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>
share|improve this answer

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.