Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I've created 2 polls, added the following into the template, and it doesn't display the random poll:
<umbraco:Macro PollNodeId="1505" DisplayOnly="0" SubmitOnSelect="0" HideSubmit="0" SortResults="1" WidthTotalVotes="1" HideQuestion="0" RandomPoll="1" Alias="Poll" runat="server"></umbraco:Macro>
1505 is the polls ID
Poll A: ID 1505
Poll B: ID 1539
What am I missing?
Hi,
If you want to display a random poll you have to set the PollNodeID to the document containing all polls
Hi Tim,
The PollNodeID is 1505.
Poll A: ID 1506
Just had the same issue. In poll.ascx.cs
Changeint rnd = random.Next(0,polls - 1);
to:
int rnd = random.Next(0,polls);From my reading of rand.Next the first parameter is inclusive and the 2nd parameter is exlcusive.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Display random poll not working
I've created 2 polls, added the following into the template, and it doesn't display the random poll:
1505 is the polls ID
Poll A: ID 1505
Poll B: ID 1539
What am I missing?
Hi,
If you want to display a random poll you have to set the PollNodeID to the document containing all polls
Hi Tim,
The PollNodeID is 1505.
Poll A: ID 1506
Poll B: ID 1539
Just had the same issue. In poll.ascx.cs
Change
int rnd = random.Next(0,polls - 1);
to:
int rnd = random.Next(0,polls);
From my reading of rand.Next the first parameter is inclusive and the 2nd parameter is exlcusive.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.