View :
<select id="count" name="count" class="form-control">
<option value="0">Choose</option>
<option value="2">two</option>
<option value="3">three</option>
<option value="4">four</option>
<option value="5">five</option>
</select>
Jquery:
<script>
$("#count").change(function () {
let count = $("#count :selected").val();
if (count != 0) {
$.getJSON("/AdminPanel/Poll/Create/" + count);
}
});
</script>
Controller :
public IActionResult Create(int id)
{
ViewBag.Count = id;
return View();
}
How can Send Value As Viewbag to View From Controller?
I want use in loop... in razor page