0
votes

Url will be http://localhost:54088/UserAdmin/FindUser?UserId=COMPANY%5Ckarimf Server Error in '/' Application. The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /UserAdmin/FindUser

Controller

public ActionResult FindUser(string UserId)
        {
            User user = db.Users.Find(UserId);
            return View(user);
        }

view

 @if (Request.IsAuthenticated && User.IsInRole("Edit-Content")) {
            @Html.ActionLink("Edit", "FindUser", "UserAdmin",
              new { UserId = item.UserId }, new { @class = "btn btn-primary" })} |
            @if (Request.IsAuthenticated && User.IsInRole("Delete-Content"))
            {
                @Html.ActionLink("Delete", "Delete", "UsersAdmin",
                     new { UserId = item.UserId }, new { @class = "btn btn-danger" }) 
            }
1
Had a similar Problem a few days ago, im pretty sure it has nothing to do with the Authentication. Its something with your Controller or the URL, consider checking the Host Properties - QuestGamer7
i know the problem in controller routing , i had the same function for search works well , but i don't know what's the problem in editing user ! @QuestGamer7 - user9077365

1 Answers

0
votes

i solved it .. the controller name missing s in UserAdmin