31.10.2014 Views

Developer's Guide - EPiServer World

Developer's Guide - EPiServer World

Developer's Guide - EPiServer World

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

100 | Developer’s <strong>Guide</strong> <strong>EPiServer</strong> Community 3.1<br />

2.25 Poll<br />

The Poll module provides functionality that enables the creation of polls, voting and getting the vote count of specific<br />

choices within a poll. Voting in polls is available not only for the community members but community site visitors can<br />

also take part in voting; this can be useful to get feedback even from people who are not members.<br />

2.25.1 Adding a Poll<br />

Before a poll can be used, first it has to be created and added to the community. To add a poll, first an object of Poll<br />

type has to be created, and then it has to be committed in the database using the AddPoll method of the PollHandler<br />

class.<br />

Import Necessary Namespaces<br />

First, import the necessary namespaces that will be used to add a poll. The namespaces StarSuite.Core,<br />

StarCommunity.Core and StarCommunity.Modules.Poll are described by clicking on their respective names. Make sure<br />

you add the assembly as a reference, mentioned in section 1.1.1.<br />

using StarSuite.Core;<br />

using StarCommunity.Core;<br />

using StarCommunity.Core.Modules;<br />

using StarCommunity.Core.Modules.Security;<br />

using StarCommunity.Modules.Poll;<br />

© <strong>EPiServer</strong> AB

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!