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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:03:45+00:00 2026-05-27T11:03:45+00:00

I want Add Select Activity values as first values of HTML dropdown, but when

  • 0

I want Add “Select Activity” values as first values of HTML dropdown, but when I add it is showing as last record in Drop down.

I want to show Default value as “Select Activity” in drop down.

I am using ASP.NET MVC3, code:

public SelectList GetSubContractorechniciansList(String subContractorId)
{
    var s1 = GetSubContractorechnicians(subContractorId);
    var result = s1.ToList().Select(d => new
    {
        Key = d.TECH_NUMBER,
        Value = d.EMPLOYEE_TECH_NAME.ToString()
    }).Distinct().ToDictionary(mc => mc.Key, mc => mc.Value);
    result.Add("Select Activity", "Select Activity");
    var selectItems = new SelectList(result, "Key", "Value");            
    return selectItems;
}
  • 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-27T11:03:46+00:00Added an answer on May 27, 2026 at 11:03 am

    You do this when rendering the dropdown in your view:

    @Html.DropDownListFor(x => x.SomeModelProperty, Model.Items, "Select Activity")
    

    or if against all good practices you don’t use a view model and rely on weakly typed ViewBag and helpers:

    @Html.DropDownList("ddlName", (IEnumerable<SelectListItem>)ViewBag.Items, "Select Activity")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to add a Select One option to a drop down list bound
There is a select dropdown and I want to add "No selection" item to
I have a form and I want to add a select location option. How
I have a list of string values that I want add to a hashtable
i want to add select query result into dataset, so i can write new
I want to add options to select language somewhere close to the facebook like
I have create the list-activity.Now I want to add new view with with map
I want to add a simple onChange event to a select list I have
I have a select list with optgroups. I want to add a handler for
hi i am using codeigniter , i want to add a multi select box

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.