Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 220939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:59:11+00:00 2026-05-11T18:59:11+00:00

I have to generate a list of items on a website which are random

  • 0

I have to generate a list of items on a website which are random for the session of the user for that particular list of items.

I am going to add a link to demonstrate the problem.
WebSite Link

Scenario:
When a user comes in and clicks on the link, the items on the page should be randomized. As the user clicks on page two, three onwards, it should follow the same random pattern that it generated the first time so that when I go back to the first page the items on that page would be same as when the user first clicked on the link.

I did think of bringing out a dataset of all items randomized once and keeping them in session but that is a last resort.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T18:59:11+00:00Added an answer on May 11, 2026 at 6:59 pm

    1) Your randomizer must be repeatable: by using a unique seed for each user and using the Random() class, you can generate the same sequence of random numbers
    across multiple HTTP requests. However, you must store the seed somewhere (I would suggest a cookie or hidden input element).

    public Random GetGenerator() {
    DateTime now = new DateTime();
    long ticks = now.Ticks();
    
    if(getCookie("ticks") > 0) {
    // existing user:
    ticks = getCookie("ticks"); // you must implement this to get the user's seed
    } else {
    // new user:
    setCookie(now.Ticks()); // you must implement this to set a Cookie/input field value
    }
    
    return new Random(ticks);
    }
    

    2) You must generate M*(N-1) numbers to finally get to the random numbers for page N, where M is the number of items per page. Only then can you start generating random numbers for the requested page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use simplified select one tag, which would generate select items list
I have code that adds list items to an unordered list, and associated with
I'm a bid new in ASP.net and developing a website that holds user-friendly list
I have a Silverlight app that is getting a list of items from a
I have a list of items and would like to generate all possible subsets.
I have to generate labels from a list of user data stored in a
I have a ViewData that is being used to generate a List, upon selecting
I would like for the generate List view contents to have a check added
I have an html file and i need to generate a list of all
I want to generate a list using my django model say I have these

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.