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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:05:31+00:00 2026-05-24T23:05:31+00:00

//Model public class SelectModel { public string CategoryId { get; set; } public List<SelectListItem>

  • 0
//Model
public class SelectModel
{
    public string CategoryId { get; set; }
    public List<SelectListItem> List { get; set; }
}

//ViewModel
public class ViewModel
{
    public SelectModel SelectMod { get; set; }
}

//OnIndex call
@Html.Partial("ViewUserControl1", Model.SelectMod)

//ViewUserControl1.cshtml
@model MvcApplication4.Models.SelectModel
<div id="formid">
    @using (Ajax.BeginForm("Index1", "Home", new AjaxOptions { UpdateTargetId = "formid" }, new { id = "TheForm" }))
    { 
        @Html.DropDownListFor(x => x.CategoryId, Model.List, "--Select One--")
        <input type="submit" name="name" value="Submit" />
    }
</div>

//Controller
 public ActionResult Index1(SelectModel sm)
 {
     return PartialView("ViewUserControl1", sm);
 }

So now when you post the Ajax.BeginForm we get the selectedId of the form and not the FULL DROPDOWN LIST.
If i have many dropdown list do i need to create the sm again with full dropdown list.
Is there a way where i can send the whole dropdown list to the controller and return back the same.

Update :
Should’t there be a param in AjaxOptions which allows us to post the full list(if we need) of the page along with the selectedIds.

  • 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-24T23:05:32+00:00Added an answer on May 24, 2026 at 11:05 pm

    The short answer is no! Since dropdownlists in HTML don’t return all their members, just the selected one(s).

    The longer answer is that ASP.NET WebForms allows you to do what you ask for, and you could recreate some of that by creating a similar mechanism as the ViewState is in ASP.NET WebForms.

    What ASP.NET WebForms does is that it stores all the values from the list in the page twice. Both in the list for display, and also a copy in a hidden field called the ViewState. The hidden field is then sent back to the server on submit and used to repopulate the dropdownlist.

    You could mimick the same behaviour ASP.NET WebForms uses in MVC by serializing your collection in some way and putting it in a hidden field. Then on submit, you can deserialize the data from the hidden field back into the collection and use it to populate the dropdown.

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

Sidebar

Related Questions

If this is my view model: public class ViewModel{ public string SimpleProperty{get;set;} public SubViewModel
Model: public class EmailAttachment { public string FileName { get; set; } public string
I have model public class MyModel { public string Name { get; set;} }
I've got a model: public class OverdraftForm { public string CustomerId { get; set;
I have: 1) public class Model { public String Name { get; set; }
I have a model: public class MyListModel { public int ID {get;set;} public List<User>
Model: public sealed class Model { public string Value { get; set; } }
I have the following Model: public class Person { public string Name {get;set;} public
I have a model public class Person { public string Name { get; set;
I have a simple Model: public class MyModel { public string Text{get;set;} } I

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.