I have used jquery, when I click on the dropdown it will take the value and will search related to the input. But it is not taking the value correctly. If I click on one value it is taking the next value.
<%= Html.DropDownList("Roles", ViewData["Roles"] as SelectList,"Select" , new {onchange = "javascript:ddlRoleChanged();", id="ddlRoles", @class = "dropdownStyle2"})%>
This is my dropdown. I am taking the id and pass into jquery like the following,
function ddlRoleChanged() {debugger;
var selectedValue = $('#ddlRoles').val();
window.location = '/home/homepage?variable=' + selectedValue.valueOf();
};
selectedvalue
is taking the value. But it is not coming correctly. Please help me.