Here's a drop-down list created in Razor View:
var currencies = Model.AvailableCurrencies.Select(x => new SelectListItem
{
Text = x.Name,
Value = webHelper.ModifyQueryString(Url.RouteUrl("ChangeCurrency", new { customercurrency = x.Id }), "returnurl=" + HttpUtility.UrlEncode(HttpContext.Current.Request.RawUrl), null),
Selected = x.Id.Equals(Model.CurrentCurrencyId)
});
@Html.DropDownList("customerCurrency", currencies, new { onchange = "setLocation(this.value);" })
I need to make a Bootstrap-3 Like dropdown:
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" href="#">Currency
<i class="fa fa-angle-down pull-right"></i>
</a>
<ul class="dropdown-menu" >
@foreach(var currency in Model.AvailableCurrencies)
{
<li><a href="">@currency.Name</a></li>
}
</ul>
But how to determine the effect of these list items, how is this done on the previous code on the razor? Please help with some code ...
Sujit source
share