Click here to Skip to main content
6,306,412 members and growing! (19,676 online)
Email Password   helpLost your password?
Web Development » ASP.NET » General     Advanced

Generic Graphical Voting Poll Web Application

By dzzxyz

Generic voting poll web application for conducting polls from your website.
C#.NET 1.0, .NET 1.1, Win2K, Win2003, ASP.NET, Dev
Posted:17 Feb 2004
Updated:24 Feb 2004
Views:52,590
Bookmarked:20 times
Unedited contribution
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
20 votes for this article.
Popularity: 3.22 Rating: 2.48 out of 5
9 votes, 45.0%
1
3 votes, 15.0%
2
2 votes, 10.0%
3

4
6 votes, 30.0%
5

This generic voting poll web application tutorial was brought to you by
www.pcbutton.com - (2004 campaign buttons, political buttons 
and memorabilia buttons)

What is a voting poll web application?

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.

 

Why add a voting poll to my website?

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.

 

How to configure this voting poll for my own
elections on my 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

 

Example application of this voting poll web application:

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:

 

 

Sample image

 

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:

 

Sample image

 

What if someone votes twice?

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)
{
.
.
.


 

 

 

 

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

dzzxyz


Member
Keep on coding!
Occupation: Web Developer
Location: United States United States

Other popular ASP.NET articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 13 of 13 (Total in Forum: 13) (Refresh)FirstPrevNext
QuestionHow can i use this with masterpage Pinmembermtajuddin23:38 2 Apr '09  
Generalwhatever PinsussAnonymous5:35 8 Sep '04  
GeneralRe: whatever Pinmemberfrank63014:34 24 Dec '06  
GeneralI need this for my site PinsussAnonymous11:29 20 Apr '04  
GeneralRe: I need this for my site Pinmemberfrank63014:36 24 Dec '06  
GeneralHmmm... PinsussAnonymous11:19 3 Mar '04  
GeneralNice! Pinmemberwahoot_9:37 19 Feb '04  
GeneralThanks PinsussAnonymous8:18 19 Feb '04  
GeneralVERY COOL!! PinsussAnonymous8:17 19 Feb '04  
GeneralWYSIWYG? Pinmembertstih23:01 18 Feb '04  
GeneralRe: WYSIWYG? PinsupporterPaul Selormey3:43 19 Feb '04  
GeneralRe: WYSIWYG? Pinmemberleppie7:48 19 Feb '04  
Generalleppie PinmemberDaniel Stephen Rule15:11 14 Apr '04  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin 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