Click here to Skip to main content
12,998,483 members (127,982 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hi! Currently I am trying to create a project where I list, edit, delete and create personal details for persons. I am at a stage where I need to create a address page.

I wanted to create a drop down menu similar to a style like Html.DropDownListFor object in which I had 2 options. One option would generate below a form with certain fields, which can be edited, and second option would generate also different field, which can be edited.(The process should be happening in the same page)

Can anyone tell me where to start researching, because I can't find the right keywords for this in google?
Posted 9-May-13 20:26pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

What you have done so far and where are you stuck ?

over all

1.Create an MVC 4.0 project and point to a database (does automatically up to some extend)
2.Create the classes you need (Code first method)
3.Generate the pages (can do automatically)

If you need a menu option then have to consider something like bootsrap or similar -[^]

Let me know, if this any help or you need more detailed (if so, which manner and what you have done so far?)
Māris Jurgenbergs 10-May-13 4:07am
This is the view page I commented, where I wanted the drop down list style object and what it would filter.
Answers to your questions:
1.Have done that.
2.Atm I have the classes to create the view i posted below. I think I need to create this filter menu in order to create other classes which edit the view below I posted.
3.Not sure what did you mean by generate pages. Is compiling what you ment?

I just need a field which has 2 drop down options. I was told that this can be done with java, but I am not experienced with java.
<pre>@model PersonRegisterProject.ViewModels.AddressViewModel
ViewBag.Title = "AddressIndex";
<style type="text/css">
color: #8C1717;
background-color: #b0b0b0;
border: 1px #000;
@*@Html.Partial("Navigation", new PersonRegisterProject.ViewModels.NavigationViewModel() { PersonId = @Model.PersonId, Identifier = @Model.Identifier })*@


@using (Html.BeginForm())
@Html.HiddenFor(address => address.PersonId)
@*DropDownListFor the option to be able to choose few of the <div> fields. Depends on the option you choose *@
@*option 1 start*@
@Html.LabelFor(address => address.RegionId)
@Html.DropDownListFor(address => address.RegionId, Model.Items)
@Html.ValidationMessageFor(address => address.RegionId)
@Html.LabelFor(address => address.ParishId)
@Html.DropDownListFor(address => address.ParishId, Model.Items2)
@Html.ValidationMessageFor(address => address.ParishId)
@Html.LabelFor(address => address.CityId)
@Html.DropDownListFor(address => address.CityId, Model.Items3)
@Html.ValidationMessageFor(address => address.CityId)
@Html.LabelFor(address => address.SuburbId)
@Html.DropDownListFor(address => address.SuburbId, Model.Items4)
@Html.ValidationMessageFor(address => address.SuburbId)
@Html.LabelFor(address => address.Street)
@Html.TextBoxFor(address => address.Street)
@Html.ValidationMessageFor(address => address.Street)
@Html.LabelFor(address => address.HouseNr)
@Html.TextBoxFor(address => address.HouseNr)
@Html.ValidationMessageFor(address => address.HouseNr)
@Html.LabelFor(address => address.HouseDetails)
@Html.TextBoxFor(address => address.HouseDetails)
@Html.ValidationMessageFor(address => address.HouseDetails)
@Html.LabelFor(address => address.PostalCodeId)
@Html.DropDownListFor(address => address.PostalCodeId, Model.Items5)
@Html.ValidationMessageFor(address => address.PostalCodeId)
@Html.LabelFor(address => address.RecordDate)
@Html.TextBoxFor(address => address.RecordDate)
@Html.ValidationMessageFor(address => address.RecordDate)
@*option 1 end*@
@*option 2 start*@
@Html.LabelFor(address => address.CountryId)
@Html.DropDownListFor(address => address.CountryId, Model.Items6)
@Html.ValidationMessageFor(address => address.CountryId)
@Html.LabelFor(address => address.Address)
@Html.TextBoxFor(address => address.Address)
@Html.ValidationMessageFor(address => address.Address)
@*option 2 end*@

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170622.1 | Last Updated 10 May 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100