Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am new to SharePoint and I have created several custom lists. I would like to use visual studio 2010 to create new EDIT/NEW/DISPLAY forms for this list. I can't seem to find anything on the internet explaining how to design these new forms with Visual Studio 2010. I would like for some guidance on how this can be done. I simply want to change the UI of the forms and make it look pretty using JQuery and that is the only purpose I have.

<?xml version="1.0" encoding="utf-8"?>

</Fields>
<Views>
  <View BaseViewID="0" Type="HTML" MobileView="TRUE" TabularView="FALSE">
    <Toolbar Type="Standard" />
    <XslLink Default="TRUE">main.xsl</XslLink>
    <RowLimit Paged="TRUE">30</RowLimit>
    <ViewFields>
      <FieldRef Name="LinkTitleNoMenu"></FieldRef>
    </ViewFields>
    <Query>
      <OrderBy>
        <FieldRef Name="Modified" Ascending="FALSE"></FieldRef>
      </OrderBy>
    </Query>
    <ParameterBindings>
      <ParameterBinding Name="AddNewAnnouncement" Location="Resource(wss,addnewitem)" />
      <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
      <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_ONET_HOME)" />
    </ParameterBindings>
  </View>
  <View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
    <Toolbar Type="Standard" />
    <XslLink Default="TRUE">main.xsl</XslLink>
    <RowLimit Paged="TRUE">30</RowLimit>
    <ViewFields>
      <FieldRef Name="Attachments"></FieldRef>
      <FieldRef Name="LinkTitle"></FieldRef>
    </ViewFields>
    <Query>
      <OrderBy>
        <FieldRef Name="ID"></FieldRef>
      </OrderBy>
    </Query>
    <ParameterBindings>
      <ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
      <ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
    </ParameterBindings>
  </View>
</Views>
<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 question
Have you seen sharepoint.stackexchange.com/questions/7417/… ? – eirikb Sep 26 '12 at 19:00
Yeah I actually came across this post several times and I am having a hard time trying to perform the same actions. I simply would like to create new forms for the custom list definition I created In VS2010. Are there any standard documentation explaining the correct "non-hack" way of creating forms. – Joseph D Surgeon Sep 26 '12 at 19:12
To make it real simple. I would like a tutorial that can show me how to create a list definition with all views from within Visual Studio without copying and pasting generated code. I know there is a formal way on how to do custom lists and forms from vs2010 without "hacks" – Joseph D Surgeon Sep 26 '12 at 19:55

1 Answer

up vote 0 down vote accepted

There are Two ways u set your application page as List Default New/Edit/Display Form.

  1. Check This http://ikarstein.wordpress.com/2010/12/29/walkthrough-create-custom-sharepoint-2010-list-form-for-deployment-in-a-visual-studio-2010-project/

  2. also in schema of your custom list definition add this after FieldRefs

     <XmlDocuments>
    <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
      <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
        <Display>ListForm</Display>
        <Edit>ListForm</Edit>
        <New>ListForm</New>
      </FormTemplates>
    </XmlDocument>
    <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
      <FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
        <Edit>HERE IS THE URL OF YOUR CUSTOM PAGE</Edit>            
      </FormUrls>
    </XmlDocument>
     </XmlDocuments>
    
share|improve this answer
That was all I needed one more question under the <FormTemplates> node do I specify just the name of the form. and then it uses the FormUrls tag to reference the actual form. Could you post an example of those tabs populated. I really appreciate your help and I will mark your answer as the answer because it answered my question. – Joseph D Surgeon Sep 27 '12 at 17:13
Here is my list schema here I don't see how to implement your code. – Joseph D Surgeon Sep 27 '12 at 18:29
see This screencast.com/t/Tr5shVtu5ZVv – Vishal_Sharepoint Sep 28 '12 at 5:07
Does that go into the Schema file. I see field references under the content type node. But in schema there is a <Fields> and a <ViewFields> node so when I add my content type to the schema should it have field references also. What about the <Forms> tag should this be deleted – Joseph D Surgeon Sep 28 '12 at 13:03
Thank you once again you are really helping me grasp this I am new to sharepoint but not .NEt – Joseph D Surgeon Sep 28 '12 at 13:04
show 4 more comments

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.