![]() |
Web Development »
ASP.NET »
General
Advanced
Generic Graphical Voting Poll Web ApplicationBy dzzxyzGeneric voting poll web application for conducting polls from your website. |
C#.NET 1.0, .NET 1.1, Win2K, Win2003, ASP.NET, Dev
|
||||||||||
|
Advanced Search |
|
|
|
||||||||||||||||
This generic voting poll web application tutorial was brought to you by
www.pcbutton.com - (2004 campaign buttons, political buttons
and memorabilia buttons)
A voting pollweb application is a web page that
you can add to your website to allow users to
vote on stuff, chat about the poll�s candidates
and support their preferred choice in the voting poll.
A voting poll like this will let you take statistics on
user choices, provide entertainment for your users
and even assist you in marketing products on your
website.
Simply edit vote.xml to hold information about your
voting poll:
<candidates> <polltitle>2004 Presidential Campaign Voting Poll</polltitle> <pollinstructions>Click on the candidate that you believe should be the next president of the United States of America.</pollinstructions> <candidate>
name of a chatroom for candidate should
anyone decide to chat about this candidate.
Can be any IRC channel name that you can
think of without the '#' :
<chatroomname>SBT10027BUSH</chatroomname>
Picture of the candidate:
<image>SBT10027BUSH.jpg</image>
URL that the user may visit when they vote for this candidate:
<url>http://www.pcbutton.com/</url>
Call the candidate something:
<candidatetitle>George W Bush</candidatetitle>
Store the IP address of each vote to prevent duplicate votes:
<votes> <vote>192.168.0.77</vote> <vote>192.168.0.71</vote> </votes> </candidate> . . .
Note: Be sure to configure IIS to not allow users to
browse to vote.xml if you do not want it to be publicly available.
And you will need to grant ASP.NET write access to vote.xml:
1. Right-click vote.xml in explorer
2. Click "properties"
3. Click the "security" tab
4. Click "add" and add the ASPNET user
5. Highlight the ASPNET account
6. Check the "write" box in the "allow" column
Here is an example application of this voting poll web application. In this case,
a poll of the 2004 elections is taken and lists some of the candidates:

After the user votes they receive confirmation of their vote and get
to see the status of all the candidates. They also get the option to
support their favorite candidate with a political campaign button, in
this example, from http://www.pcbutton.com/, or chat about the
candidate that they voted fore with other supporters:

After the user
If someone votes twice from the same IP address then his or her second vote will be rejected:
. . . for(iAllVotes = 0;iAllVotes < pAllVotes.Count;iAllVotes++) { if(pAllVotes[iAllVotes].InnerText == strVoterId) { bChad = true; } } if(!bChad) { . . .
| You must Sign In to use this message board. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 24 Feb 2004 Editor: |
Copyright 2004 by dzzxyz Everything else Copyright © CodeProject, 1999-2009 Web11 | Advertise on the Code Project |