Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • syn-rg 282 posts 425 karma points
    Apr 09, 2010 @ 09:23
    syn-rg
    0

    Display random poll not working

    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?

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Apr 09, 2010 @ 09:40
    Tim Geyssens
    0

    Hi,

    If you want to display a random poll you have to set the PollNodeID to the document containing all polls

  • syn-rg 282 posts 425 karma points
    Apr 12, 2010 @ 09:27
    syn-rg
    0

    Hi Tim,

    The PollNodeID is 1505.

    Poll A: ID 1506

    Poll B: ID 1539

  • skiltz 501 posts 701 karma points
    Sep 06, 2010 @ 09:46
    skiltz
    0

    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.

     

     

  • 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.

Please Sign in or register to post replies