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 6070085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:53:37+00:00 2026-05-23T09:53:37+00:00

I am running into issue with a project I am working on. I have

  • 0

I am running into issue with a project I am working on. I have a Task Scheduler. The models consists of Jobs and Tasks. Job and Task have a many to many relationship. I maintain the relationship to task in Job through a List Tasks property. I want the user to be able to arrange the List of Tasks in a specific order, so that I can execute them in a precise manner. I constructed methods for ordering the tasks, but the code first framework always maintains the relationship in a order based on ID. Thus, the order is lost. Does anyone have idea of how to implement something like this in MVC 3?

  #region 
JobModel
    public class Job
    {
        public int ID { get; set; }        
        public string Name { get; set; }
        public string Description { get; set; }
        public DateTime? Date { get; set; }
        public int JobCategoryID { get; set; }       
        public virtual JobCategory JobCategory { get; set; }

        public virtual List<Task> Tasks { get; set; }

    }
    #endregion

    #region TaskModel
    public class Task
    {
        public int ID { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }  
        public virtual ICollection<Job> Jobs { get; set; }

    }
  • 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-23T09:53:37+00:00Added an answer on May 23, 2026 at 9:53 am

    While explicitly for MVC2, I have found this article and code within Mvc Nested List Tutorial to be extremely helpful.

    I have used it to do exactly what you are describing by embedding the sort order in the model of the class and sorting on in during the view.

    You should be able to create javascript or other actions to reorder and adjust the hidden sort values for each element. Then after the post each element should be correctly sorted.

    Good Luck

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

Sidebar

Related Questions

I'm running into an issue while unit-testing a Python project that I'm working on
I'm running into an issue where I have a FileUpload control in an UpdatePanel.
I'm currently using Entity Framework and am running into this issue: The relationship between
I am developing a issue logger for my project and am running into an
I'm working on a project using Apache Tiles 2.1 . I am running into
I'm working on a framework and have run into an issue. I noticed that
I'm currently working on a project in c# where I have a service running
Working on an iOS project that targets 4.0 and 5.0, using ARC. Running into
I'm using aino-convert on a project and running into an issue I've never seen
I am trying to debug a project, suddenly I'm running into an issue where

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.