Summary
This article outlines the steps on how to set Survey Plus web part properties by default
Product & Version
KWizCom Survey Plus Standard Evaluation 3.x.xx for SharePoint 2007
KWizCom Survey Plus Standard Evaluation 13.x.xx for SharePoint 2010
Resolution
In order to set Survey Plus web part properties you need to add reference to the following assemblies:
1. KWizCom.SharePoint.WebParts.QuickPoll.dll
2. Microsoft.SharePoint.dll
3. KWizCom.SharePoint.Foundation.dll
Please find an example below:
using System;
namespace Sample
{
public class SurveyPlusProperties
{
public System.Web.UI.WebControls.WebParts.WebPart SetSurveyPlusProperties(System.Web.UI.WebControls.WebParts.WebPart wp)
{
KWizCom.SharePoint.WebParts.QuickPoll.QuickPoll quickPoll = (KWizCom.SharePoint.WebParts.QuickPoll.QuickPoll)wp;
#region Survey Data Source
// • Survey List URL = [Site URL]
quickPoll.PWPProperties.ListUrl = "[current site]"; // http://site
// • List Name = [Survey List Name]
quickPoll.PWPProperties.ListName = "Company Survey";
#endregion
#region General Display Settings
// • CSS File = [hardcoded URL]
quickPoll.CssFile = "/_layouts/survey.css";
// • Show Already Responded Message = True
quickPoll.ShowAlreadyRespondedMessage = true;
// • Show “Clear” Button = False
quickPoll.ShowClearButton = false;
// • Show “Results” Button = False
quickPoll.ShowResultButton = false;
#endregion
#region Survey Questions Settings
// • Display Survey Date = True
quickPoll.ShowPollQuestionDate = true;
// • Display Survey Title=True
quickPoll.ShowPollTitle = true;
// • Survey Plus Title=[Title of Survey]
quickPoll.PollTitle = "Survey Plus";
#endregion
#region Survey Results Settings
// • Display Survey Date = True
quickPoll.ShowPollAnswersDate = true;
// • Display Survey Results Title = True
quickPoll.ShowResultTitle = true;
#endregion
#region Survey Submit Settings
// • Submit Behavior = Redirect_to_a_Different_Url
quickPoll.AfterSubmitResult = KWizCom.SharePoint.WebParts.QuickPoll.AfterSubmitResult.Redirect_to_a_Different_Url;
// • Redirect URL = [hardcoded URL]
quickPoll.RedirectUrl = "http://newurl";
#endregion
#region Appearance
// • Chrome Type = none
quickPoll.ChromeType = System.Web.UI.WebControls.WebParts.PartChromeType.None;
#endregion
return quickPoll;
}
}
}
On a scale of 1-5, please rate the helpfulness of this article
Optionally provide private feedback to help us improve this article...
Thank you for your feedback!