I have two dropdownlists in my module.
In one drop-down list, I hard-coded all operators like <,>,<=,>=,==
In the second drop-down list, I have a salary with a hard pointer, for example 1000,2000,3000,4000....50000
Now, if I select < from one list and 2000 from the second list and press the submit button, I should get a list of employees whose salaries are less than 2000.
I want to do this in asp.net mvc3
How can I complete this task ???
Do I need to write a stored procedure for this?
can someone help me?
I created a dropdownlist as:
viewModel.OperatorsList = new[] { new SelectListItem { Value = "<", Text = "<" }, new SelectListItem { Value = ">", Text = ">" }, new SelectListItem { Value = "<=", Text = "<=" }, new SelectListItem { Value = ">=", Text = ">=" }, new SelectListItem { Value = "==", Text = "==" } }; viewModel.SalaryList = new[] { new SelectListItem { Value = "1000", Text = "1000" }, new SelectListItem { Value = "2000", Text = "2000" }, new SelectListItem { Value = "3000", Text = "3000" }, . . };
and I used this to show a dropdown:
<%: Html.DropDownListFor(x => x.Operators, Model.OperatorsList)%>