Visual Studio .NET 2003Windows 2003.NET 1.1Visual Studio 2005Windows 2000.NET 2.0IntermediateDevVisual StudioJavascriptWindows.NETASP.NETC#
Microsoft Content Management Server Decline Reason Extension (C#)






4.33/5 (3 votes)
A Web Author extension that prompts authors to enter a reason when declining postings.
Introduction
For use in Microsoft Content Management Server, this Decline Reason Web Author extension prompts authors to enter a reason when declining postings. It works in both single posting declines in the Web Author menu and multiple posting declines in the Approval Assistant dialog. The reason entered can be collected using Request.Form["NC_DeclineReason"]
within the events CmsPosting_Declining
and CmsPosting_Declined
in global.asax, and be used for email notifications (code sample not included).
A VB.NET version of this extension is available here.
Installation Procedures
- Copy all the files in directory WebControlLibray to the web control library project of your MCMS solution.
- Copy the directory WebAuthor into the root of your web site. The file /WebAuthor/Client/Console.js contains the scripts for the custom console actions. If Console.js exists already, copy the new scripts into your existing Console.js.
- Copy the MCMS Web Author file \Program Files\Microsoft Content Management Server\Server\IIS_CMS\WebAuthor\Dialogs\TasksAssistant\ApprovalAssistant\ ApprovalAssistant.aspx into /WebAuthor/Dialogs/TasksAssistant/ApprovalAssistant/. In VS.NET 2003, when the file is included and you are asked to automatically generate the code-behind file for it, say No. Edit the file as follows:
- Change the source of the
DialogTitle
register:<%@ Register tagprefix="WebAuthor" Tagname="DialogTitle" Src="/ProjectName/CMS/WebAuthor/Controls/DialogTitle.ascx" %>
- Add a JavaScript include, an
onsubmit
attribute in theform
element, and a hidden element:..... <%=EmbedHeadSection()%> <script language="JavaScript" src="ApprovalAssistant.js" type="text/javascript"></script> </head> ..... <form id="WBC_frmApprovalAssistant" method="post" runat="server" onsubmit="return CMS_onMultipleDecline();"> <input type="hidden" name="NC_DeclineReason" value=""> .....
- Change the source of the
- Change the console actions to use the new custom classes. For example, if you are using DefaultConsole.ascx:
<%@ Register TagPrefix="CustomAction" Namespace="McmsCustom.WebAuthor" Assembly="WebControl Library Assembly Name" %> ...... <CmsConsole:Console runat="server" id="Console1"> <script language="javascript" type="text/javascript" src="../WebAuthor/Client/Console.js"></script> ...... <cms:PresentationModeContainer mode="Unpublished" runat="server" id="PresentationUnpublishedModeContainer1"> ...... <CustomAction:ApprovalAssistantCustomAction id="ApprovalAssistantAction1" runat="server"> <A id="ApprovalAssistantAnchor" href="#" onclick="<%# Container.ActionJavascript %>;return false" target=_self> <%# Container.Text %> </A> <BR> </CustomAction:ApprovalAssistantCustomAction> ...... <CustomAction:DeclineReasonAction id="DeclineAction1" runat="server"> <A id="DeclineAnchor" href="#" onclick="<%# Container.ActionJavascript %>;return false" target=_self> <%# Container.Text %> </A> <BR> </CustomAction:DeclineReasonAction> ...... </cms:PresentationModeContainer> ...... </CmsConsole:Console>
- Rebuild your site solution in VS.NET.
History
- V1.0 - 2004.04.10 - Base.
- V1.1 - 2004.07.08
- Fixed the missing buttons in the dialog.
- Split CustomAction.cs into DeclineReasonAction.cs and ApprovalAssistantCustomAction.cs.
- V1.2 - 2006.05.14 - Added a ASP.NET 2.0 version.