New Package - Poll package for umbraco 4
I finally got round to polish and package the umbraco poll I made some time ago. So here it is …
The package installs the following:
The document types (Polls, Poll, Poll Answer) will be used to setup the polls.
So you’ll have a Polls document that will contain several Poll documents and these will have several Poll Answer documents beneath it.
After you have setup a poll with some answers in your content area you can get the poll on your page.
First add a reference to the installed stylesheet (/css/Nibble.Umb.Poll.css) and then place the Poll macro on your template.
Please note that:
- The macro will have to be placed inside a form with runat=”server” attribute
- There has to be a scriptmanager on the page
The poll macro has several parameters:
- Poll Node Id: This is the id of the Poll content node that you want to display
- Display Only: Check this if you only want to display the results of a poll
- Submit On Select: Check this if you want to submit the vote when a user selects a answer
- Hide Submit: Check this if you want to hide the submit button
- Sort Results: Check this if you want that the results are sorted by number of votes
- Width Total Votes: Instead of the highest number of votes being equal to 100% width, the total number of votes is 100%
- Hide Question: Check this if you want to hide the question
- Random Poll: Check this if you want to display a random Poll, you’ll also have to update the Poll Node Id to the Polls document (containing the different polls)
So depending on the parameters (Submit On Select and Hide Submit) your poll can look like:
or (with submit button)
The Results can look like this:
Sorted:
Width Total Votes:
You can download the package here: http://our.umbraco.org/projects/poll

Another very nice package, thanks
Petr
Hi Petr, very nice package! Can you please help me to make the pollNodeId dynamic? Because this is using a .NET control, Umbraco won’t let me call the poll from an xslt file using RenderMacroContent() function. I can set the poll ID at a page level, but if I want to use the same poll on many pages, such as a blog, blog post, etc… then I would have to select the poll at each page, which is a pain! Please help!
Thanks!
Hi Petr, nice package. I’m new to umbraco but have a lot of experience with DotNetNuke and Sitefinity. With Sitefinity it’s possible to create a custom property editor. For instance an editor to select a poll from a list. Could you let me know if this is possible with Umbraco? If so, i’m willing to contribute to this module.
Hi, is there a way to display a ImageButton instead of Button for the form? Also, is it possible to have a link to show the result without voting?
Thank you
Hi there, I am new to Umbraco and I need to install this package on a website. Can someone please help me with the starting steps?
Thank you in advance
I cannot get it to work :(.
I am stuck at
Please note that:
* The macro will have to be placed inside a form with runat=”server” attribute
* There has to be a scriptmanager on the page
Can someone help please?
Thank you
hi,
the database script for “tblPoll” seems to be missing from your package install? are you able to email it to me?
thanks a lot,
andrew
Hello,
I have installed Umbraco Poll and got it working on the homepage of http://11-19.firstmedia-cms.co.uk but when I hit the Submit button on the Poll, I get the following error:-
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; MAAU; InfoPath.2; OfficeLiveConnector.1.5; OfficeLivePatch.1.3; .NET4.0C; .NET4.0E)
Timestamp: Tue, 14 Dec 2010 15:46:21 UTC
Message: Sys.WebForms.PageRequestManagerServerErrorException: Specified cast is not valid.
Line: 5
Char: 84093
Code: 0
URI: http://11-19.firstmedia-cms.co.uk/ScriptResource.axd?d=aYvNRD7Fify51xL44_N1UBmisO03m0P7zpZ9bU9b8j8VehoPYeeRPAKZ_drsuq4qxmlX2×2Ab5dhTHgtSeuBoEonwP8_E9iqTWJ1oWGANsCriRHVbjTOl9ALPXt_fWFrb7INZTrfgBbrqaaXtoPft5xK_bI7chwZqTaY28aZvas1&t=2610f696
Message: Sys.WebForms.PageRequestManagerServerErrorException: Specified cast is not valid.
Line: 5
Char: 84093
Code: 0
URI: http://11-19.firstmedia-cms.co.uk/ScriptResource.axd?d=aYvNRD7Fify51xL44_N1UBmisO03m0P7zpZ9bU9b8j8VehoPYeeRPAKZ_drsuq4qxmlX2×2Ab5dhTHgtSeuBoEonwP8_E9iqTWJ1oWGANsCriRHVbjTOl9ALPXt_fWFrb7INZTrfgBbrqaaXtoPft5xK_bI7chwZqTaY28aZvas1&t=2610f696
It is a Javascript error on the page.
What have I setup wrong?
Thanks.
Regards,
Craig.
Craig,
I am getting the exact error message as you reported. Did you happen to get a resolution to the problem?
thanks,
Brian
I am also having the same issue as “Craig on December 14th, 2010″ and “Brian Meyers on June 29th, 2011″.
When the poll is submitted I get the following error:
Error: Sys.WebForms.PageRequestManagerServerErrorException: Specified cast is not valid.
Source File: http://umbraco.dnsalias.com/ScriptResource.axd?d=WtcquFfZ5vs2GXyg7fv1E7ARMwRj7I1NdaA2LiH_G6QR6w3V82C5J00pt1DK5DPD3LOrRG5ZjpA23ZDetyDXKRyGvLP9cbkHWgf6_JJhKDz5_GTEB6lunVrpmkJTZRjXmlQEC4QGYukDCYItkRsToVwBU3vSq7RLwFBeqvPIKd4fzG-goWzspq4FhTWoBpMi0&t=2610f696
Line: 5
Has anyone found out why this happens and how to fix it?
Many thanks, Brendan
I’ve found the answer to :
Sys.WebForms.PageRequestManagerServerErrorException: Specified cast is not valid.
Simply set the votes for your poll answers to a number.
I found this by taking out the update panels and you see that there’s actually a server error in casting within the SelectAwnser() method.
If you are able to submit the source code I could have a look at fixing it for you.
I suspect its within this part:
if (document.getProperty(”votes”).get_Value() != DBNull.Value)
{
num = (int) document.getProperty(”votes”).get_Value();
}
The download link is broken.
Please update the URL.
The proper download link is:
http://our.umbraco.org/projects/website-utilities/poll
I cannot get it to work.
Please note that:
* The macro will have to be placed inside a form with runat=”server” attribute
* There has to be a scriptmanager on the page
Can someone help please???
Where can I download the source code? I tried to download it from the project site in umbraco but I get an error.
Solution for:
Sys.WebForms.PageRequestManagerServerErrorException: Specified cast is not valid.
Add this additional condition (answerDoc.getProperty(”votes”).Value.ToString() != “”), you have to do similar like this on couple of steps. line 161, 224 & 247
Eg:
On page Poll.ascx.cs line 161
if (answerDoc.getProperty(”votes”).Value != DBNull.Value && answerDoc.getProperty(”votes”).Value.ToString() != “”)
{
currentvotes = (int)answerDoc.getProperty(”votes”).Value;
}
Also package missed database script to create table tblPoll, you can add it manually
Nice package. Where did you find the documentation of how to work with databases in Umbraco? I searched for it but couldn’t find it. Any help is appreciated!