Lookup on registration page not working

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
crash
User
Posts: 148

Lookup on registration page not working

Post by crash »

Look up does not work on the registration page.
On my registration page I have the usual fields and a field that offers a lookup.

This does not work in ASP.Netmaker 2021... it worked fine before on ASPMaker.
When I logon as the admin and go to the user table to edit the lookup options are fine.
I've tried changing the permissions to add lookup for anonymous users.. this also does not work.

Any help please


MichaelG
User
Posts: 1095

Post by MichaelG »

Make sure that the Anonymous user has the lookup permission.

Also enable debug mode (Tools -> Advanced Settings -> Debug), press F12 -> Network to check the network response of the lookup request.


crash
User
Posts: 148

Post by crash »

As you can see in my post anonymous is already checked. Debug option has also been checked. Nothing unusual there.


MichaelG
User
Posts: 1095

Post by MichaelG »

MichaelG wrote:

Also enable debug mode (Tools -> Advanced Settings -> Debug), press F12 -> Network to check the network response of the lookup request.

What is the HTTP response of the lookup request then?


darkdragon
User
Posts: 148

Post by darkdragon »

I have the same issue, we have a lookup for the user registering to choose the language.
Applied lookup permissions on that specific view for anonymous role and we still get an error:

Part of the Header

Request URL: http://localhost/<website>/api/lookup?csrf_name=__RequestVerificationToken&__RequestVerificationToken=CfDJ8Fwhv4kVgeFDlnctiiPGRszaGxdNm689tV610ebuLg1tpVthMvR93Z8M8Gw0Fq8yTKLs0Wdr2a-jYeGDs4ds00_iR0nldAtnNwu6zISZ-0zQGO2b0MkL0bSFiqCCIInbRv1aBzC5N6Bc4rkgwOKraLE
Request Method: POST
Status Code: 500 Internal Server Error
Remote Address: [::1]:80
Referrer Policy: strict-origin-when-cross-origin

Response

Autofac.Core.Registration.ComponentNotRegisteredException: The requested service 'ASPNETMaker2022.Models.WWWAPP+Register' has not been registered. To avoid this exception, either register a component to provide the service, check for service registration using IsRegistered(), or use the ResolveOptional() method to resolve an optional dependency.
   at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
   at ASPNETMaker2022.Models.WWWAPP.Resolve(String name) in d:\APPS\WWWAPP\Models\aspnetfn.cs:line 1837
   at ASPNETMaker2022.Controllers.LookupController.Batch(List`1 pages) in d:\APPS\WWWAPP\Controllers\apicontroller.cs:line 306
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context)
   at Marvin.Cache.Headers.HttpCacheHeadersMiddleware.HandleResponse(HttpContext httpContext)
   at Marvin.Cache.Headers.HttpCacheHeadersMiddleware.Invoke(HttpContext httpContext, IValidatorValueInvalidator validatorValueInvalidator)
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

HEADERS
=======
Accept: application/json, text/javascript, */*; q=0.01
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9,ro;q=0.8
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiIiwiSWQiOiIiLCJQYXJlbnRVc2VySWQiOiIiLCJVc2VyTGV2ZWxJZCI6Ii0yIiwiZXhwIjoxNjU4NTAyMjkwLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiYXVkIjoiKiJ9.Ygv1D-d6mnEjK4NXoLu6UFiUjdeAw3QSidpvz_iBRUA
Connection: keep-alive
Content-Length: 127
Content-Type: application/json
Cookie: WWWAPP_autologin=; WWWAPP_password=; WWWAPP_username=; WWWAPP_lasturl=; .AspNetCore.Antiforgery.prCTxHdnYZM=CfDJ8Fwhv4kVgeFDlnctiiPGRsxtuULhd6bvogLNPL-Qg3NB5RRAhGX7t13ia9GFsxbY29Tr9jlHMbn0Oq3Lqcgl5lK6EZwtYt6wOn5yEdmc9XYOKta1Skm170Qfy2p3s-SoAPMFwG6l6C5gXcc-KN26918; .AspNet.Consent=yes; ProThemeSelection=azure-light; SidebarPaneCollapsed=1; .WWWAPP.Session=CfDJ8Fwhv4kVgeFDlnctiiPGRsy%2Bl%2BpwdnDXxfg0xqj0Yt573Onv01lJFS1fkY3AKn3529BS7On%2BVJmo4jfeTPrbLI8H1PPDGERhIFjCvckQv%2FakFGiHK%2F0gbw7%2BBdAlIkJpXLBsw%2BWAjJAjMPui1itRwWv3Zj%2F%2F2%2Fz19N%2Bas1kVxIxX
Host: localhost
Referer: http://localhost/WWWAPP/register
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36 Edg/103.0.1264.62
sec-ch-ua: " Not;A Brand";v="99", "Microsoft Edge";v="103", "Chromium";v="103"
sec-ch-ua-mobile: ?0
X-Requested-With: XMLHttpRequest
sec-ch-ua-platform: "Windows"
Origin: http://localhost
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty

Post Reply