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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T16:27:30+00:00 2026-06-14T16:27:30+00:00

I have a dropdowlist in my view <div class=editor-label> @Html.LabelFor(model => model.SubProcessId, SubProcess) </div>

  • 0

I have a dropdowlist in my view

<div class="editor-label">
                    @Html.LabelFor(model => model.SubProcessId, "SubProcess")
                </div>
                <div class="editor-field">
                    @Html.DropDownList("SubProcessId", ViewBag.SubProcessId as SelectList)
                    @Html.ValidationMessageFor(model => model.SubProcessId)
                </div>

That has this model

namespace CTTModel
{
    using System;
    using System.Collections.Generic;

    public partial class **SubProcess**
    {
        public SubProcess()
        {
            this.Risks = new HashSet<Risk>();
        }

        public int Id { get; set; }
        public string Name { get; set; }
        public int ProcessId { get; set; }
        public string Description { get; set; }

        public virtual **Process** Process { get; set; }
        public virtual ICollection<Risk> Risks { get; set; }
    }
}

which appears in the view via this controller

public ActionResult Create()
        {
            try
            {
                // Risk
                **ViewBag.SubProcessId    = new SelectList(_db.SubProcesses, "Id", "Name", "Process");**


                ViewBag.RiskSeverityId  = new SelectList(_db.RiskSeverities, "Id", "Name");
                ViewBag.RiskFrequencyId = new SelectList(_db.RiskFrequencies, "Id", "Name");
                ViewBag.RiskRatingId    = new SelectList(_db.RiskRatings, "Id", "Name");
                ViewBag.RiskType1Id     = new SelectList(_db.RiskType1, "Id", "Name");
                ViewBag.RiskType2Id     = new SelectList(_db.RiskType2, "Id", "Name");

                //Test
                ViewBag.RegionLevelId   = new SelectList(_db.RegionLevels, "Id", "Name");
            }
            catch (Exception ex)
            {
                throw;
            }

            return View();
        }

These are the suprocesses that show in the dropdownlist

Past due collection
Dealer audits
Credit Watch classification
Reconciliation
Control

Every sub process can have on process

Portfolio Management
Finance
Test Modeling

Now I was asked to show in the dropdownlist not the subprocess name, but instead

     "<process name> - <subprocess name>"   
Portfolio Management - Reconciliation, for example

And I have the faintest idea how to do that.
Any ideas??

  • 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-14T16:27:33+00:00Added an answer on June 14, 2026 at 4:27 pm
    var subProcessList = _db.SubProcesses
                            .Select(x => new 
                            { 
                                Id = x.Id,
                                Name = string.Format("{0} - {1}", x.Process.Name, x.Name) 
                            })
                            .ToList();
    
    ViewBag.SubProcessId = new SelectList(subProcessList, "Id", "Name");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code in a view: <div class=wrap_select> @Html.DropDownList(dateRange, new SelectList(Model.DateRange, Value,Text),
`//View <tr><td>Experience level</td><td><div class=editor-field> <%: Html.DropDownListFor(model => model.ExperienceLevelID, (SelectList)ViewData[Experience], --select--)%> <%: Html.ValidationMessageFor(model => model.ExperienceLevelID)
Hi I have this code in my view.. <%=Html.DropDownList(ProductTemplate,new SelectList(Model.ProductTemplate,Value,Text))%> I know if this
I have the following code- View- <% Html.BeginForm(); %> <div> <%= Html.DropDownList(DropDownSelectList, new SelectList(
i have the following view that contains an @Html.DropDownList :- <fieldset> <legend>Answer here</legend> <div
When I have a DropDownList that relevant to Model of view like this: @Html.DropDownListFor(model
i have the following code in an asp.net mvc view. <% = Html.DropDownList(Filter, new
I have a create view :- @model MvcCommons.ViewModels.CompositeViewModel @{ ViewBag.Title = Create; } <h2>Create</h2>
I have got a dropdownlist, a submit button and a textbox in my view.
I have a DropDownList that contains Station codes. @Html.DropDownList(Station, null, new { id =

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.