Voting Extensions enables users to vote on a question by communicating with a Web service to retrieve a ballot and later sending back users' votes.
The application should call the method
RequestBallot, usually in the
Initialize event handler, in order to get the ballot question and options from the Web service (specified by the
ServiceURL property). Depending on the response from the Web service, the system will raise one of the following three events:
NoOpenPoll, indicating that no ballot question is available.
WebServiceError, indicating that the service did not provide a legal response and providing an error messages.
GotBallot, indicating that the ballot question and options were retrieved and the properties
BallotOptionshave been set.
After getting the ballot, the application should allow the user to make
a choice from among
BallotOptions and set the property
UserChoice to that choice. The application should also set
UserId to specify which user is voting.
Once the application has set
UserId, the application can call
- send this information to the Web service. If the service successfully
- receives the vote, the event
- raised. Otherwise, the event
WebServiceErrorwill be raised
- with the appropriate error message.