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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:54:40+00:00 2026-05-27T21:54:40+00:00

I have a registration form for registering personal attributes. I am using both included

  • 0

I have a registration form for registering personal attributes. I am using both included Ajax.BeginForm function and also JSON to serialize the form. This form is updating the attributes and also showing the attributes if available in DB. So if a user enter the values and click the save button it is serializing the form and saving it into the db. When a user call the page; it is also using JSON to fill the form from DB if there is a available record if not just showing a blank form as usual.

Please find a part of the View below.

@using (Ajax.BeginForm(
    "savepeople", 
    "people", 
    FormMethod.Post, 
    new AjaxOptions { OnComplete = "savePicture" }, 
    new { id = "frPeople" }))
{
    @Html.ValidationSummary(true, "Problem during saving...")
      <fr>
    <h2>
        Personal Details</h2>
    <br />
        <legend>Person</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.People.Title)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.People.Title)
            @Html.ValidationMessageFor(model => model.People.Title)
        </div>
    <div class="editor-label">
        @Html.LabelFor(model => model.People.Description)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.People.Description)
        @Html.ValidationMessageFor(model => model.People.Description)
    </div>

        <p>
            <input id="saveMarker" type="submit" value="Save" />
        </p>
}

So I am using a model like:

namespace MyProject.Models
{
    public class Profile
    {
        public People People { get; set; }
// I am also referencing other models here...
    }

    public partial class People
    {
        public int PeopleId { get; set; }
        public Guid UserId { get; set; }

        public string Title { get; set; }
        public string Description { get; set; }
// It has other attributes also...
}

And controller has the classic post and get functions compatible with JSON to call and update the page.

My problem is: I am already able to handle these operations with TextBox‘s but I want to add a predefined DropDownList to use it for both saving/updating and also showing the values if it has a saved record in db.

Do you have any idea about how tho handle this issue?

  • 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-27T21:54:40+00:00Added an answer on May 27, 2026 at 9:54 pm

    This answer explains pretty good on how to use DropDownLists :
    Create a Dropdown List for MVC3 using Entity Framework (.edmx Model) & Razor Views && Insert A Database Record to Multiple Tables

    If you need kind of dictionary data for the DropDownList you can either create a ViewModel that can contain your PeopleClass and the dictionary collection for the dropdown like :

    public class EmployeeAddViewModel
    {
        public People people { get; set; }
        public Dictionary<int, string> dropdownValues { get; set; }
    }
    

    or you can assign the collection to a ViewBag variable. Try reading the Q&A linked above and if you will stumble upon a particular issue, feel free to ask 🙂

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

Sidebar

Related Questions

I have a registration form and am using $.ajax to submit it. This is
I have a basic form that I'm using for member registration. I'm using the
I'm building my first CodeIgniter app - and have a registration form. I'm using
Team I'm creating an iphone application using Sencha Touch. I have registration form ,
I have this registration form which is then validated using "bassistance's" validate.js: $('#pForm').validate({ rules:
I have registration form and I am using Django-registration. Now, I need to add
I am using ASP.net(2.0) with VB.NET. I have a User registration form. On that
I have registration form on my website that, using jquery I append default values
In my web application i have registration form, when user register i want to
I have a registration form with common registration fields and two multiple selection Lists

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.