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

  • Home
  • SEARCH
  • 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 8532699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T09:46:29+00:00 2026-06-11T09:46:29+00:00

I have a program that people can leave comments on a video. The comments

  • 0

I have a program that people can leave comments on a video. The comments come is as in queue status. The admin can go into the admin section and mark the comments as either approved or removed. They want to be able to automatically go to the next item marked in queue when they press either the previous or next buttons, as well as if they approve or remove a comment. I do not know jQuery or JavaScript well enough to know if it is possible to do it using those, or how to do it through the code behind (this is in C# .NET). Any help would be appreciated:

Status and value:
In queue = 0
Approved = 1
Removed = 2

Here is the code-behind. The status changes work, the only thing I cannot do is have it go to the next record marked in queue. The first two events are blank because I do not know how to fill them, but simply put, all the need to do too is go to the next record marked in queue.

If you need any more code, please let me know…

    protected void previous_clicked(object sender, EventArgs e)
    {   
    }

    protected void next_clicked(object sender, EventArgs e)
    { 
    }

    protected void approve_clicked(object sender, EventArgs e)
    {
        currentMessage = new videomessage(Request["id"].ToString());

        status.SelectedValue = "1";

        currentMessage.status = "1";
        currentMessage.Save();
    }

    protected void remove_clicked(object sender, EventArgs e)
    {
        currentMessage = new videomessage(Request["id"].ToString());

        status.SelectedValue = "2";

        currentMessage.status = "2";
        currentMessage.Save();
    }
  • 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-06-11T09:46:30+00:00Added an answer on June 11, 2026 at 9:46 am

    Sounds more like an architectural challenge to me.

    I recommend using a Queue. This is a collection type following a first-in, first-out (FIFO) approach. You put objects into the queue and get them back out in the same order. An object that was received out of this queue is automatically is removed from the queue, so you can be sure that you do not handle the same element twice.

    Your described workflow then would work as these simple steps:

    1. Whenever a message arrives, you put the object into your queue.
    2. When the admin clicks on the next button, you request the first object out of the queue.
    3. Your admin does his administrative tasks and approves the message.
    4. Clicking on Next start with above item 1 again.

    [EDIT]

    Oops, I realized that my Queue approach would not allow for navigating back to previous items.

    In this case I suggest using a simple List collection. This list can be accessed via the 0-based position in the list. This makes it easy to implement a forward/ backward navigation.

    For my sample code, please bear in mind that there is a lot that I cannot know about your environment, so my code make a lot assumptions here.

    You need to somwhere store a collection that contains your messages to be approved:

    private IList<videomessage> _messagesToApprove = new List<videomessage>();
    

    You will also need some variable that keeps track of the current position in your collection:

    // Store the index of the current message
    // Initial value depends on your environment. :-)
    private int _currentIndex = 0;
    

    To begin with, you will need a starting point where new messages are added to that collection, like subscribing to some event or so. Whenever a message arrives, add it to the collection by calling a method like:

    // I made this method up because I do not know where your messages really come from.
    // => ADJUST TO YOUR NEEDS.
    private void onNewMessageArriving(string messageId)
    {
      videomessage arrivingMessage = new videomessage(messageId);
      _messagesToApprove.Add(arrivingMessage);
    }
    

    The you can easily implement the navigation by incrementing/ decrementing the position index:

    private void previous_Click(object sender, EventArgs e)
    {
      // Check that we do not go back further than the beginning of the list
      if ((_currentIndex - 1) >= 0)
      {
        _currentIndex--;
        this.currentMessage = this._messagesToApprove[_currentIndex];
      }
      else
      {
        // Do nothing if the position would be invalid
        return;
      }
    }
    
    private void next_Click(object sender, EventArgs e)
    {
      // Check if we have new messages to approve in our list.
      if ((_currentIndex + 1) < _messagesToApprove.Count)
      {
        _currentIndex++;
        currentMessage = _messagesToApprove[_currentIndex];
      }
      else
      {
        // Do nothing if the position would be invalid
        return;
      }
    }
    
    private void approve_Click(object sender, EventArgs e)
    {
      // Sorry, I don't know where exactly this comes from, needs to be adjusted to your environment
      status.SelectedValue = "1";
    
      this.currentMessage.status = "1";
      this.currentMessage.Save();
    
      // If you want to remove items that have been checked by the admin, delete it from the approval list.
      // Otherwise remove this line :-)
      this._messagesToApprove.RemoveAt(_currentIndex);
    }
    
    private void remove_Click(object sender, EventArgs e)
    {
      // Sorry, I don't know where exactly this comes from, needs to be adjusted to your environment
      status.SelectedValue = "2";
    
      this.currentMessage.status = "2";
      this.currentMessage.Save();
    
      // If you want to remove items that have been checked by the admin, delete it from the approval list.
      // Otherwise remove this line :-)
      this._messagesToApprove.RemoveAt(_currentIndex);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It's well-known among teachers that some people can program and some can't. They just
I have some security built into a client side program that downloads a DLL
I have program that requires Python 3, but I develop Django and it uses
I have program that has a variable that should never change. However, somehow, it
I have program that runs fast enough. I want to see the number of
I have a program that gets a JSON from the server using getJSON and
I have a program that saves an image in a local directory and then
I have a program that reads from a file that grabs 4 bytes from
I have a program that encrypts files, but adds the extension .safe to the
I have a program that I want to distribute, without giving the source code

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.