Reputation: 93
I am new in c# and MVC and this is my question:
For my new website, I would like to have a DropDownList in my header so the visitors can choose a Currency.
I have a SQL server table named CurrencyList
I have a Controller named BaseController : Controller
I have a model:
public partial class CurrencyList
{
public int CurrencyId { get; set; }
public string CurrencyName { get; set; }
public string CurrencySymbol { get; set; }
public Nullable<decimal> CurrencyValue { get; set; }
public string Currency { get; set; }
public Nullable<System.DateTime> LastUpdate { get; set; }
}
Now, how do I get the datas in the select? And how do I manage the Post? For my select, I will use only the field Currency, and by default EUR will be selected.
Onchange, I would like to save the Currency value in a session and/or cookie.
Thanks in advance.
Upvotes: 0
Views: 92
Reputation: 935
You can use Ajax Get method to call the method of controller which get data for bind dropdown list
Upvotes: 1