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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:05:36+00:00 2026-06-04T12:05:36+00:00

I have a entity that has a scalar string property Clarified. Clarified can have

  • 0

I have a entity that has a scalar string property “Clarified”.

Clarified can have to values, “Yes” or “No”.

In my ViewModel I have following properties.

public SelectList ClarifiedTypes { get; set; }
public string Clarified { get; set; }

Inside my Get action method I have done following:

        model.ClarifiedTypes =
                new SelectList(
                new[] { new { Value = "1", Text = "Ja" }, new { Value = "2", Text = "Nej" }, },
                "Value",
                "Text");

This is how I make a DDL in my view:

 <div class="editor-field">
                @Html.DropDownListFor(x => x.ClarifiedTypes, Model.ClarifiedTypes, "Välj alternativ")
 </div>

Now my question is inside the Post action method.

In some way I need to fill my Model.Clarified with the value that was selecting from Model.ClarifiedTypes and then do following ” entity.Clarified = Model.Clarified “. I have no idea how to do this.

I have tried:

Model.Clarified = Model.ClarifiedTypes.selectedvalue.ToString();
Goalcard.Clarified = model.Clarified

But I get an error:

No parameterless constructor defined for this object.

What I want to achieve is that users should be able to choose Yes or No value inside the DDL and then that value should get filled to my entity property.

Any help is appreciated!

Thanks in advance

Update:

I am recieving this error

o parameterless constructor defined for this object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.MissingMethodException: No parameterless constructor defined for this object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

  • 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-04T12:05:38+00:00Added an answer on June 4, 2026 at 12:05 pm

    You should write

    @Html.DropDownListFor(x => x.Clarified, Model.ClarifiedTypes, "Välj alternativ")
    

    And the selected value from drop down list will be into Model.Clarified as you submit your form

    For model binding to be able to work, your model should have default constructor, otherwise mvc won’t be able to create model and bind it.

    If you cannot restore default constructor on your model, create custom model binder or better, create separate view model for it.

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

Sidebar

Related Questions

I have an entity that has a string property called Tags. I would like
I have an entity class that has an embedded object within it: @Entity public
I have an entity class that has a property with an underlying db column
I have an entity that has a ManyToMany relationship with itself: @Entity public class
I have a Video entity that has multiple Genres, public class Video { public
I have a User entity that has a IList property. The mapping for this
So I have an entity that has a navigation property which has a type
I have an entity that has so many properties and the customer wants to
I have an entity that has a collection in it. The collection is a
Imagine you have an entity that has some relations with other entities and you

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.