I work on .NET core 7 MVC razor page . I face issue I can't fill check boxes Id StockTake and ShelfLabelPrint by using ajax request to this function RelatedUserAccessPermission
URL below I run it on browser to access function RelatedUserAccessPermission
public JsonResult OnGetRelatedUserAccessPermission(int UserId)
{
var UserAccess = _db.UserAccess.ToList();
return new JsonResult(UserAccess);
}
so I need to call function OnGetRelatedUserAccessPermission from page model using ajax request .
so I need to make ajax request for that URL ?handler=RelatedUserAccessPermission
Access Rights 1 meaning it check true
Module Code 1,2 values of Id StockTake represent id 1 and ShelfLabelPrint represent id 2 based on UserId 1220
on AddUserAccess.cshtml
How to make ajax request Fill 2 check boxes when button submit click
for more details what I expect

ahmed salahPosted May 11, 2023, 1:49 AM
i gotted issue but i don't know how to solve it please
the proplem is method type is post
so after remove method of form post it working so why and how to solve it
so please how to solve this issue
ahmed salahPosted May 11, 2023, 1:32 AM
it working but not perfect
meaning checkbox #StockTake and #ShelfLabelPrint checkbox checked but after checked
it make strange action not checked
meaning some behaviour affect on check box
so it checked but quickly after less than second it not checked why
Mohamed Azarudeen ZPosted May 10, 2023, 12:59 PM
To make an AJAX request to fill the checkboxes when the "Submit" button is clicked, you can use jQuery's
$.ajax()function. Here's an example of how you can modify your code to achieve this:Gives this a Try