I have 2 dropdownlists of month and year. here is the razor code.
01.@using (Html.BeginForm("Index", "Expense", FormMethod.Get))
02.{
03. <p>
04. Month <select name="drpMonth">
05. @for (var i = 1; i <= 12; i++)
06. {
07.
08. <option>@i</option>
09. }
10. </select>
11. Year <select name="drpYear">
12. @for (var i = -3; i <= 3; i++)
13. {
14. <option>@(DateTime.Now.AddYears(i).Year)</option>
15. }
16. </select>
17. <input type="submit" value="Filter" />
18.
19. </p>
20.}
when i click on "Filter" button, a postback occurs and the selected value of the dropdownlists