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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:25:57+00:00 2026-05-22T21:25:57+00:00

When I post via the click on btSave, in the controller I receive the

  • 0

When I post via the click on “btSave”, in the controller I receive the model. In the model, I see the value off all fields (I show here only “FirstName” but there are others). But the doropdownlist value are null all the time.

Do you have an idea why ?

Thanks,

//Dropfown content
public class LkpTypeCompany
{
    public virtual int Id { get; set; }
    public virtual int Code { get; set; }
    public virtual string NL { get; set; }
    public virtual string FR { get; set; }
    public virtual string Value { get; set; }
}

//Model Definition
public class CustomerModel
{
    public List<LkpTypeCompany> LkpTypeCompany { get; set; }
    public Customer Customer { get; set; }
}

//Posting form
jQuery('#btGeneralSave').click(function (event) {
    var jqxhr = $.post("Controller/Actio,", $("form").serialize(),
    function (data) {
    });
});

//HTML
@model eSIT.GC.WebUI.Models.CustomerModel
@using (Html.BeginForm())
{
    @Html.TextBoxFor(m => m.Customer.FirstName, new { maxlength = 50 })
    @Html.DropDownListFor( m => m.Customer.LkpTypeCompany, new SelectList(Model.LkpTypeCompany, "Code", "FR", Model.Customer.LkpTypeCompany.Code))
    <input type="button" id="btSave" value="Save"/>
}
  • 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-22T21:25:58+00:00Added an answer on May 22, 2026 at 9:25 pm

    I see the overload that you were attempting to use but I have had good luch with using SelectListItem

    Try

     @Html.DropDownListFor( m => m.Customer.LkpTypeCompany, 
         new SelectList(Model.LkpTypeCompany
                             .Select(i => new SelectListItem
                                          {
                                            Text = i.Code, 
                                            Value = (*somecondition*) ? i.FR : i.NL, 
                                            Selected = i.Code == Model.Customer.LkpTypeCompany.Code
                                          }));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm stuck trying to get a WinInet HTTP POST via SSL using ONLY C.
I am trying to submit a delete link click via a http post to
I have try to post value from page a to page b via jquery
I have this little code to post via ajax: $('#submit').click(function () { var myName
i want to download a file using ajax via post request using jQuery. here
I have a form that generates new input fields via JavaScript on click. the
When sending data via POST or GET with jQuery you use for format {
I want to post some data via javascript to another domain. Something like: http://www.othersite.com/submitfunnyname?name=blah
The Setting: The program in question tries to post form data via an AJAX
I want to salt a hashed username and password (submitted via http POST) in

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.