I have a dropdownlist like this:
var Country = new List<ListItem>
{
new ListItem { Text = "American" },
new ListItem { Text = "British" } ,
new ListItem { Text = "Spanish" },
new ListItem { Text = "Persian" } ,
new ListItem { Text = "China" },
new ListItem { Text = "else" }
};
@Html.DropDownList("Country", new SelectList(Country))
When a user choose “else” , one textbox appears and user can type it’s country on textbox, I did this by jquery :
@Html.TextBox ("txtCountry",null,new {@id="txtCountry"})
I want to define a variable to get Country from user and send to database. Filed’s name in Model is “Country”</p>
How do this?