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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:31:50+00:00 2026-06-14T06:31:50+00:00

Can category model (example given below) be passed public class Category { public Guid

  • 0

Can category model (example given below) be passed

public class Category { 
     public Guid Id { get; set; }; 
     public String Title { get; set; }
}

using a select/option?

<select id="categories" name="Category">
    <option value="Id">Text</option>
</select>

As far as I understand this will bind normally but excluding Title property?

EDIT

Viewmodel

public class EditProductModelView { 
    [Required] Category Category { get; set; }
    // other properties
}

Controller

public ActionResult Edit(EditProductViewModel model) {
    // controller logic
}

Thanks!

  • 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-14T06:31:52+00:00Added an answer on June 14, 2026 at 6:31 am

    you could add a hidden input for the title value and fill it with options the data-title attribute value whenever the selection option changes

    <input id="categoriesTitle" type="hidden" name="Category.Title" />
    <select id="categories" name="Category.Id">
        <option value="foo" data-title="this is foo">foo</option>
        <option value="bar" data-title="I am bar">bar</option>
    </select>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

main table: class example(models.Model): name = models.CharField('Item Name', max_length=200) color = models.ManyToManyField(Color) category =
I'm using the custom menus in WP 3.3.1 . I can drag a category
I have a category model. I am using ancestry gem to make it like
I found an example of the nested set model that I am trying to
I have a model categories: t.string :c1 t.string :c2 t.string :c3 A category could
class Category(models.Model): name = models.CharField(max_lenth=50) class SubCatergory(models.Model): parent_category = models.ForeignKey(Category) name = models.CharField(max_length=100) class
I have this model: class Category(models.Model): name = models.CharField() description = models.CharField(blank=True) parent =
For example i have this model: class Product < ActiveRecord::Base attr_accessible :name, :order end
My models look like this: class Category(models.Model): name = models.CharField(_('name'), max_length=50) class Product(models.Model): name
I've got two models Category and Item. Category can have many items and item

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.