I used extension method and wrote a drop-down list, Now I want to get the selected value from view and pass to controller. How can do it?
public static MvcHtmlString DayDropDownCalender(this HtmlHelper helper)
{
TagBuilder daydropdown = new TagBuilder("select");
for (int i = 1; i <= 31; ++i)
{
var option = new TagBuilder("option");
option.SetInnerText(i.ToString());
option.MergeAttribute("value", i.ToString());
daydropdown.InnerHtml += option.ToString();
}
return MvcHtmlString.Create(daydropdown.ToString(TagRenderMode.Normal));
}