Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

SQLAndy

I'm Andy Warren, currently a SQL Server trainer with End to End Training. Over the past few years I've been a developer, DBA, and IT Director. I was one of the original founders of SQLServerCentral.com and helped grow that community from zero to about 300k members before deciding to move on to other ventures.

Building a PASS Voting Solution – Part 5

Today we move over to the web side of things. I put this together with VS 2010, and it’s a single aspx page with a single class and a user control. I’m using DevExpress controls (they provide me with a free subscription, good stuff).

Here’s the normal view that a voter will see if they’ve clicked a link received in email. That link would be passing in the BallotID and the VoterID. We do a check to see if the election is open, and that they haven’t already voted and if all is well, they can vote. As you can see I’m not a UI wizard! The nice part is this stuff is easy to change, it’s the plumbing that takes time to figure out.

 

image

Here is the post vote display (same page):

 

image

 

If they try to refresh to vote again they get this:

 

image

If all they have is the ballot ID (from a link we share on Twitter for example), they get a different display (same page). Because we’re going to send a email to the address they enter, I added the captcha to reduce the chances of a bot hitting it and getting us blacklisted. If the address is valid for that election we send them a full URL, otherwise they get a message that it didn’t match. Not perfect, but matches the rules we built on for this time around.

 

image

Tomorrow we’ll look at some code!

Comments

No comments.

Leave a Comment

Please register or log in to leave a comment.