I am using Visual Studio 2013 with Framework 4.
I have one model with attribute firstname.
This is my model
[Required]
[Display(Name = "Investigator")]
public string FirstName { get; set; }
This is my view where I am using:
In dropdownlist:
@Html.DropDownListFor(model => model.FirstName, Model.Names, "Enter New ...", new { @id = "ddlnames" })
@Html.ValidationMessageFor(model => model.FirstName)
In textbox:
@Html.EditorFor(model => model.FirstName)
I am using it for dropdownlist selection and in dropdownlist I have one option to add new first name and on click on that I am giving option for add new First Name with text box having same name means (FirstName) as model of razor for new entry.
So my question is can I use that FirstName attribute of model for dropdownlist selection and for new entry as well.
I am getting value in dropdownlist selection but when I enter new first name value not coming.
Please someone who knows it help me to solve this.
Thanks in advance.