Hi I have passed list items as select list in view from controller .
other data are retrieved from database
var pairList = new List<KeyValuePair<String, Int32>>();
var pair = new KeyValuePair<string, int>("Daily", 0);
pairList.Add(pair);
pair = new KeyValuePair<string, int>("Weekly", 7);
pairList.Add(pair);
//pair = new KeyValuePair<string, int>("Bi-Weekly", 14);
//pairList.Add(pair);
pair = new KeyValuePair<string, int>("Monthly", 30);
pairList.Add(pair);
ViewBag.frequency = new SelectList(pairList, "Value", "Key", null);
and it view i was to display selected value while page loads .
by some working I get the selected value like 7 or 30 etc from other functional which is also dynamic
<td id="testa">
@Html.DropDownList("testddl", ViewBag.frequency as SelectList)
</td>
How can I set selected value .
Thnaks Binaya