ASP.net
Awesome
Learn
Forum
Buy
Demos
Sign In
☾
☀
Switch to
Dark
Light
Mode
this site works best with javascript enabled
Ask Question
Prefill dropdown on redirect
Title:
B
I
{code}
?
I have a website with 2 pages, one is a grid of managers and the other a grid of employees. On the employees page, I have a drop-down to filter the employees by their manager which works. On the manager page I'd like to have a button to open the employees page and supply the manager ID in order to only show that manager's employees. From what I can tell, the URL query string is correct when clicking on the link in the managers page to go to the employees page, but I'm guessing that because the drop-down on the employees page isn't being prefilled with that manager's ID, the employees page is showing all employees. Do I need to do something to the function that's used to create the button on the managers grid in order to pre-fill the drop-down in the employees page when it redirects? Here is the code for the button on the manager's page: function employeesButtonFunc(hierarchy) { return '<button type="button" class="awe-btn" onclick="openEmployeesPage(' + hierarchy.ManagerId + ')">View This Managers Employees</button>'; } function openDriversPage(managerID) { location.href = '@Url.Action("Index", "Employees")?managerId=' + managerID; } And here is the code for the drop-down on the employees page: @Html.Awe().AjaxRadioList("managerDropDown").Url(Url.Action("GetManagers", "Data")).Odropdown() And then the grid on the employees page uses to pass the value to the controller: .Parent("managerDropDown", "managerId")
Save Changes
Cancel
Sean Davidson
asked at 23 Sep 2020
Answers
B
I
{code}
?
You need to set the dropdown value, regardless of how you get it, likely via querystring. @Html.Awe().AjaxRadioList("managerDropDown").Value(managerId)...
Save Changes
Cancel
Omu
answered at 23 Sep 2020
please
Sign In
to leave an answer
By accessing this site, you agree to store cookies on your device and disclose information in accordance with our
cookie policy
and
privacy policy
.
OK