SharePoint ChangeContentType DropDown
I have attached an application page to the custom document based content type as its edit form. That content type is being used in a document library which has more than one content type attached to it.
SharePoint form field controls render the respective fields correctly. Change content type control lists all the content types related to the lists in a dropdown as well. But when I change the selection, means when I select different content type, the form does not show the set of fields for the selected content type rather it stays as it is.
Code:
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ApplicationPage1.aspx.cs" Inherits="DMS_POC.Layouts.DMS_POC.ApplicationPage1" DynamicMasterPageFile="~masterurl/default.master" %>
<%@ Register TagPrefix="wssuc" TagName="ToolBar" src="../../../_controltemplates/15/ToolBar.ascx" %>
<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
</asp:Content>
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
<table>
<tr>
<td>
<span id='part1'>
<SharePoint:InformationBar ID="InformationBar1" runat="server" />
<div id="listFormToolBarTop">
<wssuc:ToolBar CssClass="ms-formtoolbar" id="toolBarTbltop" RightButtonSeparator="&#160;" runat="server">
<template_rightbuttons>
<SharePoint:NextPageButton ID="NextPageButton1" runat="server"/>
<SharePoint:SaveButton ID="SaveButton1" runat="server"/>
<SharePoint:GoBackButton ID="GoBackButton1" runat="server"/>
</template_rightbuttons>
</wssuc:ToolBar>
</div>
<SharePoint:ItemValidationFailedMessage ID="ItemValidationFailedMessage1" runat="server" />
<table class="ms-formtable" style="margin-top: 8px;" border="0" cellpadding="0" cellspacing="0" width="100%">
<SharePoint:ChangeContentType ID="ChangeContentType1" runat="server" />
<SharePoint:FolderFormFields ID="FolderFormFields1" runat="server" />
<tr>
<td>
<SharePoint:FieldLabel ID="lbl_ProposalNumber" runat="server" FieldName="ProposalNo" />
</td>
<td>
<SharePoint:FormField ID="field_ProposalNumber" runat="server" FieldName="ProposalNo"
ControlMode="Display" />
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td>
<SharePoint:FieldLabel ID="lbl_CustName" runat="server" FieldName="CustomerName" />
</td>
<td>
<SharePoint:FormField ID="field_CustName" runat="server" FieldName="CustomerName"
ControlMode="Edit" />
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td>
<SharePoint:FieldLabel ID="lbl_ProposalType" runat="server" FieldName="ProposalType" />
</td>
<td>
<SharePoint:FormField ID="field_ProposalType" runat="server" FieldName="ProposalType"
ControlMode="Edit" />
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td>
<SharePoint:FieldLabel ID="lbl_RevertBy" runat="server" FieldName="RevertBy" />
</td>
<td>
<SharePoint:FormField ID="field_RevertBy" runat="server" FieldName="RevertBy"
ControlMode="Edit" />
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td style="vertical-align:top">
<SharePoint:FieldLabel ID="lbl_Details" runat="server" FieldName="Details" />
</td>
<td style="vertical-align:top">
<SharePoint:FormField ID="field_Details" runat="server" FieldName="Details"
ControlMode="Edit" />
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td>
<SharePoint:FieldLabel ID="lbl_SignRequired" runat="server" FieldName="DigitalSignatureRequired" />
</td>
<td>
<SharePoint:FormField ID="field_SignRequired" runat="server" FieldName="DigitalSignatureRequired"
ControlMode="Edit" />
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td>
<SharePoint:FieldLabel ID="lbl_Amount" runat="server" FieldName="Amount" />
</td>
<td>
<SharePoint:FormField ID="field_Amount" runat="server" FieldName="Amount"
ControlMode="Edit" />
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td>
<SharePoint:FieldLabel ID="lbl_Final" runat="server" FieldName="Final" />
</td>
<td>
<SharePoint:FormField ID="field_Final" runat="server" FieldName="Final"
ControlMode="Edit" />
</td>
</tr>
<SharePoint:ApprovalStatus ID="ApprovalStatus1" runat="server" />
<SharePoint:FormComponent ID="FormComponent1" TemplateName="AttachmentRows" ComponentRequiresPostback="false" runat="server" />
</table>
<table cellpadding="0" cellspacing="0" width="100%" style="padding-top: 7px">
<tr>
<td width="100%">
<SharePoint:ItemHiddenVersion ID="ItemHiddenVersion1" runat="server" />
<SharePoint:ParentInformationField ID="ParentInformationField1" runat="server" />
<SharePoint:InitContentType ID="InitContentType1" runat="server" />
<wssuc:ToolBar CssClass="ms-formtoolbar" id="toolBarTbl" RightButtonSeparator="&#160;" runat="server">
<template_buttons>
<SharePoint:CreatedModifiedInfo ID="CreatedModifiedInfo1" runat="server"/>
</template_buttons>
<template_rightbuttons>
<SharePoint:SaveButton ID="SaveButton2" runat="server"/>
<SharePoint:GoBackButton ID="GoBackButton2" runat="server"/>
</template_rightbuttons>
</wssuc:ToolBar>
</td>
</tr>
</table>
</span>
</td>
<td valign="top">
<SharePoint:DelegateControl ID="DelegateControl1" runat="server" ControlId="RelatedItemsPlaceHolder" />
</td>
</tr>
</table>
</asp:Content>
<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
Application Page
</asp:Content>
<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
My Application Page
</asp:Content>