tag:blogger.com,1999:blog-6082652835152798567.post4216631035442565710..comments2024-03-28T21:41:58.974-07:00Comments on Sql server, .net and c# video tutorial: Manage user claims in asp.net coreUnknownnoreply@blogger.comBlogger4125tag:blogger.com,1999:blog-6082652835152798567.post-69395940011401856052023-10-04T07:03:53.981-07:002023-10-04T07:03:53.981-07:00input type="hidden" asp-for="@Model...input type="hidden" asp-for="@Model.UserId" use this the loop<br />it worked for meSri Rajendra Turagahttps://www.blogger.com/profile/17805408795260725711noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-47970863257097790852021-06-01T10:41:41.241-07:002021-06-01T10:41:41.241-07:00try with providing Route Like .
[Route("Contr...try with providing Route Like .<br />[Route("Controller/Action/{userId}"]Anonymoushttps://www.blogger.com/profile/08409555628529284856noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-61095244452387347472020-09-10T18:04:09.264-07:002020-09-10T18:04:09.264-07:00Hi Kudvenkat,
Im here regarding this issue i have...Hi Kudvenkat,<br /><br />Im here regarding this issue i have just encountered regarding this very tutorial video I am commenting under. I followed your code word by word and yet when i click on update for updating user claims, the http post request does not retrieve the userId value from Url and hence because its null so it redirects me to notfound page. i have dictated my code with yours word to word and there is no difference but somehow the problem is still there. what would you suggest in order to resolve this issue. Anxiously waiting for your response.....Muhammad Waqashttps://www.blogger.com/profile/14142568824020651535noreply@blogger.comtag:blogger.com,1999:blog-6082652835152798567.post-54338489578545827662019-11-17T02:37:49.396-08:002019-11-17T02:37:49.396-08:00It's only to show another way how the "Us...It's only to show another way how the "UserClaimsViewModel" class can be initialised.<br /> <br />public async Task ManageUserClaims(string userId)<br />{<br /> var user = await userManager.FindByIdAsync(userId);<br /> if (user == null)<br /> {<br /> ViewBag.ErrorMessage = $"User with Id = {userId} cannot be found";<br /> return View("NotFound");<br /> }<br /><br /> var existingUserClaims = await userManager.GetClaimsAsync(user);<br /><br /> var model = new UserClaimsViewModel<br /> {<br /> UserId = userId,<br /> Claims = ClaimsStore.AllClaims.Select(<br /> _ => new UserClaim<br /> {<br /> ClaimType = _.Type,<br /> IsSelected = existingUserClaims.Any(u => u.Type == _.Type)<br /> }).ToList()<br /> };<br /><br /> return View(model);<br />}Konstantinhttps://www.blogger.com/profile/00230092283282772343noreply@blogger.com