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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:52:13+00:00 2026-06-12T19:52:13+00:00

I have a DropDownList control inside of my model, TaskDetailsModel. I’ve declared my DropDownList

  • 0

I have a DropDownList control inside of my model, TaskDetailsModel. I’ve declared my DropDownList as:

<%= Html.DropDownListFor(model => model.TaskType, new SelectList(Model.TaskTypeDisplayNames, Model.TaskTypes))%>

My model’s corresponding class contains the following property declarations:

public class TaskDetailsModel
{        
    [DisplayName("Task Type")]
    public TaskType TaskType { get; set; }

    public List<TaskType> TaskTypes = new List<TaskType> { TaskType.Decommission, TaskType.Install, TaskType.Modify, TaskType.Move, TaskType.Other, TaskType.Rename };
    public List<string> TaskTypeDisplayNames = new List<string> { "Decommission", "Install", "Modify", "Move", "Other", "Rename" };
}

When everything loads and displays to the user — the correct TaskType selection has been made. That is, I have no problem loading with the non-default select option. As such, I believe that at least part of this code is working properly.

However, any changes made to the select are lost. When I attempt to post my form back to the server — I see that my selected option never changes. I was wondering what I am doing incorrectly to incur such behavior.

Update:

public TaskDetailsModel(Task task)
{
    TaskType = task.TaskType;
}

//Client-side code to retrieve form values:
var getDialogData = function () {
    var dialogData = {};

    $(workflowDialogContent).find('input,p,select').each(function () {
        if ($(this).is('input')) {
            dialogData[this.id] = $.trim($(this).val());
        }
        else if ($(this).is('select')) {
            //At this point in time the selected option does not match what I see on the screen. The user has modified the selected value. I do not see it reflected here.
            console.log("Inside here for:", this);
            dialogData[this.id] = $.trim($(this).find('option:selected').val());
        }
        else {
            dialogData[this.id] = $.trim($(this).text());
        }
    });

    return JSON.stringify(dialogData);
};
  • 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-12T19:52:14+00:00Added an answer on June 12, 2026 at 7:52 pm

    The issue is actually with the fact that I am renaming my enum values in an apparently improper fashion. The only values which get lost when passing back to the server are selections which have spaces in them. (e.g. changing to ‘Decommission’ is fine, but changing to ‘Waiting For Customer’ fails to translate properly).

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

Sidebar

Related Questions

I have a web user control with a dropdownlist inside of it. When the
Greetings, I have asp.net check box control and asp.net dropdownlist control inside div tag.
I have an ASP.NET DropDownList control that renders into a dropdown list (select HTML
I have a DropDownList inside a repeater control in an ASP.NET page that has
I'm building an asp.net cutom control inside which I have two dropdownlists: companyIdSelection and
I have asp:DropDownList control which i want to display data to user who don't
I have a dropdownlist. A column called id has the control dropdownlist ( I've
I have an ASP.NET DropDownList control that retrieves the first and last name from
I have an ASP.NET webform on which I use a DropDownList control to allow
I have a simple DropDownList . A column with the control DropDownList . The

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.