745 questions
0
votes
1
answer
59
views
asp-area in forms generating a wrong route
I have a problem in ASP.NET Core 5. When I use asp-area for example like this:
<form asp-area="Admin" asp-controller="User" asp-action="Register">your text
the ...
0
votes
1
answer
56
views
I am trying to setup Custom Attribute that handles That httponlyCookie exists or not
Microsoft.AspNetCore.Authorization is used to validate token while is there any attribute that checks httpOnlyCookie present in browser and is valid i.e like it also checks role based authentication.
...
0
votes
1
answer
79
views
Simple Modal Popup not working ASP.NET Core 5
I am trying to have a simple modal popup showing news articles. This is on the home page. I show articles, if they are longer than 200 characters I replace the remaining characters with a button that ...
0
votes
0
answers
222
views
Multiple Newtonsoft options
I need the returns from only one controller of my solution to serialize the enums into string (use Newtonsoft StringEnumConverter), I tried all the solutions I could find, none of them works, knowing ...
0
votes
0
answers
213
views
Empty cookie and session after stripe checkout redirection
Environment:
.NET Core 5
ASP.NET Core 5 MVC + Web API
EC2 + stripe
I have a web application built with ASP.NET Core 5 MVC, including a Web API project, and other class libraries. The application is ...
0
votes
0
answers
124
views
.NET Core Consumer Kafka error deadlock SQL Server
I am new to .NET. I have micro services using .NET Core. This service is used to become a Kafka consumer. In the consumer function there is a function to insert into the SQL Server database. This ...
0
votes
0
answers
114
views
EF Core Db First: 'Value was either too large or too small for an Int16' Error
I am developing a web application using .NET 5. I am using Oracle 12 as the database and generating entities with Oracle.EntityFrameworkCore v.5.21.
I have a table TableA in the database, and it has a ...
-1
votes
1
answer
245
views
ASP.NET Core 5 Web API for CRUD return value is too complicated for the controller to return
In my ASP.NET Core 5 Web API controller, I have this code:
[HttpGet("GetByUID/{uid:int}")]
public async Task<ActionResult<PTHeading>> GetPTHeading(int uid)
{
...
0
votes
1
answer
221
views
Passed parameter in ASP.NET Core 5 reactjs textfield to controller is always 0
I am new to React.js and ASP.NET Core 5 and I'm developing using Visual Studio Mac. I'm having this problem where the value being passed from text field to controller is always zero (0) even though I ...
0
votes
1
answer
47
views
ASP.NET Core 5 MVC : unable to cast between types in SeedData
I'm trying to use ASP.NET Core 5 to create a to do list and I"m trying to incorporate my seed data.
This is my model class:
using Microsoft.AspNetCore.Components.Forms;
using System....
0
votes
0
answers
32
views
How can i create different multiple Register and login form using UserManger and SignInManager in same AccountController?
namespace BloodBank.Controllers
{
public class AccountController : Controller
{
private UserManager<Donor> _userManager;
private SignInManager<Donor> _signInManager;...
0
votes
0
answers
112
views
How to access resources from the server
I have published an ASP.NET Core 5 Web API on Windows Server 2019 with IIS and I can't get access to my generated QRs, out of the server you can access with www.page.com/api/files/QRs.png but I need ...
0
votes
1
answer
58
views
Flushing the templatecache programatically
we have some sites running Umbraco9, where we have a few templates that are updated by outside developers. We are hooking up to an FTP and downloading their templates (.cshtml), and in backend their ...
0
votes
1
answer
639
views
How to force all URLs to lowercase in ASP.NET Core 2.2 and newer version?
I want to convert all URLs to lowercase.
For example:
https://ABC123.com/ -> https://abc123.com/
https://StackoverFlow.com/ -> https://stackoverflow.com/
Thanks in advance
1
vote
0
answers
131
views
Why is ASP.NET Core 5 replacing the URL query string with a random query string after the page prerender?
I am creating an ASP.NET 5 Blazor Server application with MudBlazor.
I have a URL https://localhost:44324/OperationsAll?Proj_ID=23407&Tail_Nr=TG6R&Location=N.
The query string is used to ...
0
votes
1
answer
714
views
Return any response from my Web API in result object
I have an ASP.NET Core 5 Web API. How can I return the results from all my controllers in a Result object, regardless of the return type of controller?
Something like this:
Result: {
"...
2
votes
1
answer
1k
views
IdentityServer4.Validation.TokenRequestValidator: Invalid authorization code
I am using Identity Server 4 With Microsoft Blazor application. Authentication process works fine in local. But after deploying changes in azure it was working fine before one week. Suddenly it's ...
0
votes
1
answer
251
views
windows login name by IHttpContextAccessor.HttpContext is Null .net 6
enter image description here
enter image description here
and add services in startup .
but when i make this process on core 5 ,this process is Done .
1
vote
1
answer
513
views
How to set [NonAction] attribute on some actions of ASP.NET Core 5 Web API in startup
I need to add [NonAction] or [ApiExplorerSettings(IgnoreApi = true)] attribute on some actions of my ASP.NET Core 5 Web API in startup by external json file, or example list of action names.
List<...
0
votes
1
answer
522
views
Why does asp.net core deserialize json null property (list) as an empty list
ASP.NET Core 5 deserializes json null property (list) as empty list in controller parameter (HttpPost).
I did not configure anything in startup.
The property is expected to be null instead of empty ...
0
votes
2
answers
432
views
How do I pass a parameter to a Controller which contains a dot?
I am validating using jQuery:
$el.rules("add", {
remote: {
url: `/api/distributors/KeywordExists`,
type: "post",
data: {
id: @Model....
0
votes
1
answer
323
views
Http session encryption in ASP.NET Core 5.0
I'm using session Id in HTTPsession in ASP.NET Core 5.0:
HttpContext.Session.SetString("CompanyID", Convert.ToString(session.CompanyID));
Do I need to encrypt my id or will it get encrypted ...
1
vote
1
answer
1k
views
Force user to change password in ASP.NET Core 5
I am working on a web application using ASP.NET Core 5 Razor Pages.
I have created a custom user class named ApplicationUser and added LastPasswordChange (Nullable DateTime) to it. In this application,...
1
vote
0
answers
65
views
How do I deploy my ASP.NET Core 5 MVC app with user secrets on my Windows hosting
I have been looking for this a few hours and can't seem to get a good result.
All my sensitive data is stored in my secrets, but how do I call it on the published server?
2
votes
1
answer
1k
views
Modal pop up not showing in ASP.NET Core 5
I am working on an ASP.NET Core 5 MVC application, and i'm trying to display a bootstrap modal popup. I used the code below:
Index.cshtml:
<button type="button" class="btn btn-info&...