Category "asp.net-core"

Razorpages Post new record and return to page with updated Id

Using Net6.0 Razorpages, I have a form that returns a Person by Id, and allows the user to update the record or add a new Person OnPost. When posting a new reco

Audit.Net: Audit Record Not Rolling Back When saving master record throws DbUpdateException

I have been using Audit.EntityFramework.Core v14.6.3 in my .Net Core v2.2 Web API. When I update a table record, it threw dbUpdateException error due to a check

Validation occurs even Data Anotations is not set

I am working on dot net core 3.1.I have a form for submitting product details. I have used Data annotations with jquery validations. My problem is when I try to

unable to send an email after deployment of website using asp.net mvc 5

I am trying to send an email using asp.net MVC 5 I use the number of repositories for email it's working on local but after deployment, it's not working where I

How do I capture the data sent by ajax in asp.net razor page?

I'm trying to populate a partial view with the data of the user i clicked on. Here is the code: <tbody class="text-center "> @foreach

Request is missing required authentication credential. Expected OAuth 2 accesstoken, login cookie or other valid authentication credential(Googleads)

I am trying to migrate Adwords API(sunset on 27th April, 2022) to Google Ads api. Using Asp.Net Core(5.0) and c#. Exception: Google.Ads.GoogleAds.V10.Errors.Goo

Decorate MediatR IRequestHandler using Microsoft DI

I'm trying to decorate some of my MediatR's IRequestHandlers. To mark handlers I wanted to decorate, I created the interface ICommandHandler that inherits

Using RestSharp to request a file fails with memory issue

I have to API's talking to each other on Kubernetes. The first API asks the second API for a small file using RestSharp (in ASP.NET). The file is 8Kb so basical

Create log files with Serilog only if their is any logs

I want to write different logs on different log files with Serilog by API request. The problem is when the log file configured within LoggerConfiguration(), the

Prevent DefaultAntiforgery from logging errors

Is there a way to stop DefaultAntiforgery from logging errors? I see it takes an ILoggerFactory as parameter, which is a public type, but I don't know how to se

Get Identity Role id - ASP.NET Core MVC

I am new to ASP.NET Core MVC, and I'm trying to develop a popup modal for Edit and Create. The create popup works, but when it comes to edit I can't get the id

SignalR TypeError: Failed to fetch after deploying to Azure

I am trying to create a small chat app using SignalR. In my backend I am using .net Core 5 and in Frontend, I am using React. When running in localhost every th

Generate JWT Token for logged in user?

I have a razor pages app [username and password auth] and a WebAPI app that uses JWT auth. Both the services use the same user table. After user proceeds to che

Net Core 2.2 Web App - Cookie of browser too large on specific server

I have a web application running on .Net Core 2.2 and so far it has been deployed on various servers on IIS screenshot of web.config The cookies created on all

Azure devops appsettings.json variable substitution from Key Vault in pipelines not working

I have a .Net 6 web application that I am building in devops. I am trying to substitute settings in the appsettings.json, but somehow can't get it working. What

How is Windows Authentication Wired Up?

I'm in the process of creating an ASPNET Core 6 MVC app in VS 2022 which will eventually be deployed in a Docker container. Windows Authentication will be used

Difference between instance of HttpClient and IHttpClientFactory in .NET Core5

Below is my Startup.cs public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration;

ASP .NET Core custom authentication scheme with external login

I have a website where users log in on an external website and are redirected back with a token in the querystring. I then validate the token and create the aut

Error when using CreatedAtRoute in ASP.NET Core minimal API

I'm trying to use CreatedAtRoute in minimal API. app.MapGet("/clients/{id:int}", [EndpointName("GetClientById")] async (int id, ClientsContext db) => await

How to monitor CPU and RAM consuming by a .NET Core application

I am working on an ASP.NET Core Web API application in which I am working with the files security. I want to monitor the maximum and minimum RAM and CPU consump