Click here to Skip to main content
15,887,386 members
Everything / Web Development / ASP.NET / ASP.NET Core

ASP.NET Core

ASP.NET-Core

Great Reads

by Ivan Yakimov
What are certificates in ASP.NET, why we need them, how to create self-signed certificate for testing and use certificates with ASP.NET Core
by Robert_Dyball
Add JSON Web Token Authentication (JWT) using OpenIDDict to our ASP.NET Core + Angular 2 SPA. Source includes VS2015 and VS2017 versions.
by kusnaditjung
Web specification and framework
by thangchung
Learn to organize clean architecture to modular patterns

Latest Articles

by Nicolas DESCARTES
How to implement authentication in Blazor and ASP.NET Core ?
by Mohammad Elsheimy
Porting Windows Fonts to Linux
by Zijian
Overcome the 53-bit limitation of number of JavaScript while keeping strongly typed integral types of .NET. Part 2.
by Dev Leader
Learn to create tests, use advanced techniques, and improve your code quality!

All Articles

Sort by Updated

ASP.NET Core 

N 24 Apr 2024 by Nicolas DESCARTES
How to implement authentication in Blazor and ASP.NET Core ?
3 Apr 2024 by Srijita Bhattacharya
System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=SmartInvoice StackTrace: at SmartInvoice.Pages.Master.Pages_Master_Index1.d__9.MoveNext() in...
3 Apr 2024 by OriginalGriff
To add to what Graeme has said, this is one of the most common problems we get asked, and it's also the one we are least equipped to answer, but you are most equipped to answer yourself. Let me just explain what the error means: You have tried...
3 Apr 2024 by Graeme_Grant
The answer is in the error message "Object reference not set to an instance of an object". Check the model on the server side in the controller by setting a breakpoint on the return statement. Then check the properties for a null value.
27 Mar 2024 by Richard MacCutchan
.net pie chart - Google Search[^]
27 Mar 2024 by Member 16231578
looking for source code to create pie chart in vb.net. What I have tried: nothing yet ... looking for setting it up. Have alreadt created project in visual studio.
18 Mar 2024 by Pete O'Hanlon
To my mind, the most obvious thing to investigate is the name of the property that is expected at the server side of the POST call. Verify whether or not it is called NewUserId. I suspect that it's actually called UserId which you are picking up...
18 Mar 2024 by Private Dobbs
This is a very strange issue which I have batted around for 2 or 3 days. I'm using a Net Core 6.0 MVC web app. In my view model I have a property like this: public class ConfirmCodeViewModel { ... public long NewUserId { get; set; } ... } ...
16 Mar 2024 by Andre Oosthuizen
Quote: I have tried this using Partial view but not achieved the goal and not understanding anything as I have not good grip on Jquery ajax so suggest me the solution for this The following might be difficult to grasp as per your own admission....
16 Mar 2024 by Tayyab Ali 2024
So I have the view named Edit User and in that view I have this portion of code provided below and in users list view I have button named ROles in Action part so what i want is when i click on that button only this part should popup how can i...
7 Mar 2024 by Pete O'Hanlon
As well as OriginalGriff's answer, a further enhancement for you is to not use Console.WriteLine in your web applications. This doesn't write where you think it's going to write. Change this to use logging and you will get a better view of any...
4 Mar 2024 by OriginalGriff
Start by adding three breakpoints: one at the start of the method, one at the end, and one in the catch block. Run your code in the debugger and when it hits the first breakpoint let it continue so you can see which of the other two it hits. If...
4 Mar 2024 by Stylus STYLUS
Not read data from database In table porezi have data My code Table header have, table data no have, no error Some help? using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using System.Data.SqlClient; namespace...
4 Mar 2024 by Pete O'Hanlon
So, this file is supposed to exist in %WinDir%\System32\Inetsrv\Config, and not at your site level. You can't put a local version in and have it picked up by IIS; that's not the way it works.
3 Mar 2024 by Member 14703094
I am trying to change the order of modules in the IIS pipeline in the ApplicationHost.config file, so I have created a following file and placed it in the site directory on the server, but unfortunately nothing happened. Here are the contents of...
28 Feb 2024 by Richard Deeming
Assuming it's the "Add trailing slash" rule that's causing the problem, your match is missing the "start of line" anchor: should be:
27 Feb 2024 by Member 14703094
We have an ASP.NET Core 7 MVC app hosted on Azure and IIS. For some purposes, like adding a trailing slash, we use URL rewrites. But this rule appears to cause a problem with unwanted redirects from URL parameter, so for example,...
25 Feb 2024 by SulfySul
I have been working on Flutter development using SQL Database + ASP.NET REST API for the backend. However, I'm now considering transitioning to either Firebase or Appwrite due to their increasing popularity and ease of implementation. As I plan...
23 Feb 2024 by Zijian
Overcome the 53-bit limitation of number of JavaScript while keeping strongly typed integral types of .NET. Part 2.
19 Feb 2024 by Mukesh Mishra 2023
Hello everyone, I am creating an application using reactjs as a frontend, asp.net 6.0 as a backend, I want to create report in crystal report and export this report to PDF and Excel using asp.net core web api. I have written code in asp.net but...
19 Feb 2024 by Richard Deeming
Solved: Crystal Reports for Visual Studio and .NET Core 5.... - SAP Community[^] This thread suggests that Crystal Reports does not support .NET Core / .NET 5+; it only works in .NET Framework. You will either need to rewrite your application...
16 Feb 2024 by Dev Leader
Learn to create tests, use advanced techniques, and improve your code quality!
15 Feb 2024 by Dev Leader
How to leverage WebApplicationFactory in ASP.NET Core for testing
31 Jan 2024 by Graeme_Grant
While waiting for you to update your question, I used your question in google search: How to append new node in existing XML through api C#[^] and there were many answers to the same question: * C#, XML, adding new nodes - StackOverflow[^] *...
31 Jan 2024 by OriginalGriff
XML (and JSON) are Text based data transfer formats: the only practical way to add a new node is to read the XML file into an XMLDocument (or equivalent), add the node to that, and save the XML file again. You can't just open the "raw" XML as...
31 Jan 2024 by Diku241
I want to append new node into existing xml file, data that is coming from api of json type independently from model class elements should be append into the file. What I have tried: I have tried many ways but not done please give reply
29 Jan 2024 by M Imran Ansari
The Cross-Origin Resource Sharing (CORS) issue is related to the web browser is blocking a web page from making requests to a different domain than the one that served the web page. Ensure that your server is configured to include the appropriate...
29 Jan 2024 by Member 14370529
I have an angular app deployed locally on IIS port 80, and an ASP.net core web API deployed on IIS locally port 8080. I get the below error from dev toools console registration:1 Access to XMLHttpRequest at...
7 Jan 2024 by Pete O'Hanlon
Out of the box, you can't automatically generate API documentation for JsonResult. As you aren't returning a concrete type, with a well defined structure for a particular result, it's difficult for Swashbuckle to know what to produce. What you...
7 Jan 2024 by GinCanhViet
Swashbuckle can automatically generates API documentation based on code (with details return model) [HttpGet] public ActionResult> GetStudents() { return CollegeRepository.Students; } https://i.stack.imgur.com/hHGze.png It...
25 Dec 2023 by Divya Shrivastav
This will create new cookie : // Set a cookie with a virtual path HttpCookie myCookie = new HttpCookie("MyCookie"); myCookie.Value = "CookieValue"; myCookie.Path = "/virtualpath"; Response.Cookies.Add(myCookie); In my application already the...
19 Dec 2023 by Richard Deeming
Since your repository code is swallowing all exceptions - an extremely bad idea, by the way! - the only reason for a NullReferenceException would be that the baseRepository is null. Check the constructor to make sure you've assigned the field...
18 Dec 2023 by A Belal
in Repository Pattern System.NullReferenceException Delete Method System.NullReferenceException HResult=0x80004003 Message=Object reference not set to an instance of an object. Source=Microsoft.EntityFrameworkCore StackTrace: at...
18 Dec 2023 by M Imran Ansari
As the error message, the issue is in Delete method. The Delete method attempts to remove an entity from the context using LapShopContext.Set().Remove(entity). However, the error you're encountering is a NullReferenceException, which suggests...
12 Dec 2023 by M Imran Ansari
In ASP.NET, when you set a cookie, the path can be a virtual or a physical path. If you want to set the virtual path in a cookie, you can do so in your ASP.NET code without explicitly configuring anything in IIS. Please make sure the expiration...
12 Dec 2023 by Divya Shrivastav
I didn't know to set the virtual directory path .I know to set physical path of application.I think it must be the setting in IIS server. If Yes then please let me know how to do?? What I have tried: I am trying to set virtual path folder in...
10 Dec 2023 by Graeme_Grant
Is it a commercial project? Will it be over US$1 million pa income? There is this: syncfusion community licence[^] ... a commercial library with a free licence.
8 Dec 2023 by Zijian
A series of articles comparing programmer experiences of Angular, Aurelia, React, Vue, Xamarin and MAUI
8 Dec 2023 by Mark Pelf
I am planning the development of ASP.NET Core MVC Razor application and am looking for FREE library of some quality that supports MVC/Razor development. I see plenty of commercial libraries like Kendo UI that can be used, but I am looking for...
6 Dec 2023 by Maciej Los
The error message is very clear. An instance of MS SQL Server named ".\MSSQLSERVER2022" does NOT exist on server machine or is NOT accessible from the WAN. You can resolve your issue by doing the following: 1) check connection string, especially...
6 Dec 2023 by Dave Kreskowiak
Call your hosting provider and bring the error up with them. The error means your code cannot connect to the SQL Server because there's no server to be found. You might want to make sure the name is correct as you put ".\MSSQLSERVER2022". The "."...
6 Dec 2023 by Member 11400059
Hi I create asp.net core mvc project with .net core 7. now I want put my site on host. I do this and configure the Plesk but i get this error: An unhandled exception occurred while processing the request. Win32Exception: The system cannot find...
29 Nov 2023 by Dave Kreskowiak
Nothing is displayed because the code stops running when the error is thrown. In javascript, the error "Cannot read properties of undefined" means you're trying to call a method or property of a variable that does not hold an object. You're...
29 Nov 2023 by A Belal
i want to do Pagination for View Page named ItemsList data comes well in Console in browser but it doesn't show on screen What I have tried: Array(10) 0 : {itemId: 2, itemName: 'MacBook Pro', salesPrice: 1339.69, purchasePrice: 1205.72,...
20 Nov 2023 by Richard Deeming
You have no [Authorize] attribute on your ValuesController or any of its actions. Unless you have some configuration that you haven't shown, all of those actions will allow anonymous callers. Simple authorization in ASP.NET Core | Microsoft Learn[^]
20 Nov 2023 by Zijian
A series of articles comparing programmer experiences of Angular, Aurelia, React, Vue, Xamarin and MAUI
20 Nov 2023 by Andre Oosthuizen
Ok, so first - to run some error checking outside of your app, clear your browser cache or any other caching mechanisms that might be storing the old token as this might become an issue. I have converted your code to what I think might work,...
20 Nov 2023 by A Belal
I get tokenKey from path https://localhost:7107/api/login And when i try to test token and get data from Path https://localhost:7107/api/Values the token work good and data comes well but when i remove token the data continue come and...
18 Nov 2023 by Zijian
A series of articles comparing programmer experiences of Angular, Aurelia, React, Vue, Xamarin and MAUI
17 Nov 2023 by Member 16142785
To send HTML table rows to an MVC controller for saving in a database, you can use JavaScript/jQuery to gather the data from the HTML table and send it to the controller using an AJAX request. Here's a basic example of how you can achieve this: ...
17 Nov 2023 by M Imran Ansari
I believe you should attempt it by yourself and then share any challenges you encounter by posting a question about them. You can achieve this task using AJAX POST method call, generate an array of objects and transfer the table rows to the...
17 Nov 2023 by Moaz mohammed 2021
@model System.Data.DataTable @{ ViewData["Title"] = "Index1"; } Print Save
12 Nov 2023 by A Belal
I have a problem in Calling Web Api using jquery when calling Web Api using jquery and open Console from browser Error is jquery-3.3.1.min.js:2 Uncaught TypeError: (h.dataType || "*").toLowerCase is not a function at Function.ajax...
11 Nov 2023 by Richard MacCutchan
jquery-3.3.1.min.js:2 Uncaught TypeError: (h.dataType || "*").toLowerCase is not a function The expression in parentheses yields a boolean value. And you cannot call toLowerCase on a boolean (i.e True or False) value.
7 Nov 2023 by Maciej Los
Quick research on Google: Quote: Multiple form field elements in the same form have the same id attribute value. This might prevent the browser from correctly autofilling the form. To fix this issue, use unique id attribute values for each form...
7 Nov 2023 by Michael Gledhill
A cheatsheet for getting your Web APIs up and running as quickly and painlessly as possible
6 Nov 2023 by akhter86
I tried below,but it is not updating into database from webgrid dropdown What I have tried: @model IEnumerable @{ Layout = null; WebGrid webGrid = new WebGrid(source: Model, canPage: true, canSort:...
6 Nov 2023 by Maciej Los
I'd strongly suggest to read this: Working with Stored Procedure in Entity Framework Core[^]
6 Nov 2023 by Member 13800132
I have two projects that I need to link together if possible. I've got a C# Windows Form that runs a load of functions. I also have an ASP.NET web page which gives some similar functionalities via a web page. At the moment, they are separate....
5 Nov 2023 by Graeme_Grant
If you want to include a web project within a WinForms application, then traditionally that is not possible, as pointed out by Dave. What you can do is use a WebBrowser control pointed at your website. However, it is possible to create a Hybrid...
5 Nov 2023 by Dave Kreskowiak
You don't host the web service in a Windows Forms app. The normal way to do this would be to have all the functionality exposed and processed by the web service and just rewrite your Forms app to pass data to and call the web service. Or is...
5 Nov 2023 by A Belal
I have a controller named Categories. I have one form or One View for Create And Edit. Create Action works well, but when I click Edit, the NewRow is added in database. The problem is I want to Edit Row without adding new in database. What I...
1 Nov 2023 by ahmed_sa
I work on Visual Studio 2022 ASP.NET Core 7 applications with C#. The project is not big, may be small or medium. After opening my computer and starting to work on Visual Studio 2022, it fills memory until the computer hangs or freezes and gives...
31 Oct 2023 by M Imran Ansari
Experiencing performance issues and memory consumption problems with Visual Studio can be frustrating, and there are a few steps you can take to optimize your development environment and prevent your computer from hanging or freezing. You need to...
25 Oct 2023 by ramesh P Oct2023
I had developed the blazorWASM Hosted Application with IndexedDb. This application has two projects, client and server projects. Client project purely runs on browser and server project contains ASP.NET Core API and ASP.NET Core Server hosted...
24 Oct 2023 by Member 11400059
I have ASP.NET Core MVC project with .NET 7. I want put my SQL Server connection string in appsetting file. Then use that in my entire project and the layers. But I get the provider error: System.InvalidOperationException: 'No database provider...
21 Oct 2023 by Graeme_Grant
String keys are "case sensitive". Change this: builder.Services.AddDbContext(options => options.UseSqlServer(builder.Configuration.GetConnectionString("Con1"))); .. to this: builder.Services.AddDbContext(options => ...
19 Oct 2023 by MrLonely_2
I want to send an email from my domain address in C#, but I get an error. This is my code: var smtp = new SmtpClient { Host = "webmail.myDomain.gov.sa", Port = 25, EnableSsl = true, DeliveryMethod =...
19 Oct 2023 by M Imran Ansari
The error message you received indicates that the connection attempt to the SMTP server failed. There could be several reasons like firewall, network, SMTP configuration or credential issue. Try to verify each of these potential issues to...
18 Oct 2023 by OriginalGriff
We can't help: you need to contact the email hosting provider and ask them. Fixing this needs access to your host settings including your username and password which (I assume) we do not have (and if we do, you need to change them immediately).
16 Oct 2023 by Graeme_Grant
.Net (Core)Hosted Services run in a different container to normal Dependency Injection, therefore, to access, you need to access them differently. You can read about it here: Background tasks with hosted services in ASP.NET Core | Microsoft...
12 Oct 2023 by ahmed_sa
I work on ASP.NET MVC app. I am facing an issue. I can't add text input filter on top of every column to filter. With another meaning, I have a datatable that has 3 columns, RequestNo, EmpId and EmpName. So I will add 3 input box filters for...
11 Oct 2023 by Richard Deeming
Oh look: another day, another zero-effort "do my work for me" question from our resident help vampire. It's not like 30 seconds in Google would yield an exact example of what you're trying to do[^], is it? 🤦‍♂️ But why bother learning, or...
10 Oct 2023 by ernie lipford
I'm using the react asp.net core preview project with Visual Studio 2022. I have created a controller called WordController. My vite.config.js is as below. When I run the application, however, the request still keeps resolving to...
3 Oct 2023 by ahmed_sa
I work on Blazor application server side. I design web API to interact with razor pages. My issue is which is suitable for my scenario? Using ADO.NET or Entity Framework Core? What I try is as below: So is using data reader ADO.NET better or...
2 Oct 2023 by Graeme_Grant
I would compare EF Core with Dapper, not Ado.Net. Here are a couple of videos that go into detail... * Entity Framework Core vs Dapper Performance in 2023 - YouTube[^] * Making Entity Framework Core As Fast As Dapper - YouTube[^]