<select id="TypeOfUser" name="typeOfUser" class="active text-normal">
<option value="2" onclick="location.href='@(Url.Action("Index", "User", new { typeOfUser = 2}))'">CMS Users</option>
<option value="3" onclick="location.href='@(Url.Action("Index", "User", new { typeOfUser = 3}))'">Site Users</option>
</select>
选择下拉项目我想用选定的值调用我的操作方法 -
public async Task<IActionResult> Index([FromQuery] int typeOfUser = 2)
{
SearchUsersResponse searchUserResponse = await new SearchUsersHandler(_db).Handle(new SearchUsersCommandAsync
{
Type = typeOfUser
});
return View("Index", searchUserResponse);
}
目前在下拉选择更改中我无法调用操作方法。