Click here to Skip to main content
15,887,369 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 

20 Feb 2018 by #realJSOP
I've never had to deal with this, but is it possible that putting the 2nd app into its own area would work? Areas | Microsoft Docs[^]
11 Aug 2018 by #realJSOP
0) Allow the user to specify the column names and types. 1) Create a collection of an object that store your column names and types. Make sure you add code to prevent duplicate column names. There are several techniques you can use to black-box this code so you can hide validation complexity....
13 Jun 2019 by #realJSOP
"prevent multiple tabs in browser of a given web site" - Google Search[^]
2 Jul 2019 by #realJSOP
Clear your cached data. Happens all the time, in all browsers.
6 Apr 2020 by #realJSOP
If your device isn't a HID (human interface device), you won't be able to access it. If it *is* a HID, there are ways to do it. Google "usb hid from web site". You'll get thousands of results.
22 Jun 2020 by #realJSOP
I've been writing code for over 40 years, so do with this as you see fit... If it were me, I'd write a windows service that lives on the web server to do this. Of course, if it were me, I'd put log entries into a database (instead of cluttering...
14 Jul 2020 by #realJSOP
Try reducing the BatchSize to 1000 (500,000) seems way to high to be efficient). It will be obvious within a second or two if it's going to work. by simply monitoring the row count in the target table. Another option is to read a certain...
10 Aug 2021 by #realJSOP
We can't fix your code. You have to develop some form of debugging ability. Use the developer console in the browser to find out what's happening. You'll probably have to add console.log() statements to your javascript at key points to help you...
5 Dec 2021 by #realJSOP
0) You don't need to store the "full project number" string. You can build it when you query the database to retrieve the desired data. 1) You shouldn't create a new project in the database unless certain minimal criteria have been met. This...
20 Dec 2021 by #realJSOP
Use reflection. I change the object names a bit and refactored the sample list, but you'll get the picture. public class InboundDataItem { public string OriginCompany { get; set; } public string OriginState { get; set; } public...
22 Dec 2021 by #realJSOP
Don't do it in .Net - let the database do it. Setup a job that sends the reminders every day at a specific time. Keep in mind that you'll probably need to setup a no-reply email account in order to use an SMTP server. Don't forget to give the...
7 Feb 2022 by #realJSOP
There's at least one article here n CP that describes some methods for doing this: Different Ways to Pass Data to Partial View[^]
30 Mar 2022 by #realJSOP
Why can't you simply present a TextArea that allows the user to review/edit, along with a Send button that does the mechanical stuff (using mailto). BTW, you can add attachments with mailto - How to use mailto: links to send attachments? :...
20 Apr 2021 by .NET- India
Hi, I am able to send email in asp.net core web api with attachments but attachments exists locally in a folder of api application. But i want to send attachment dynamically i.e. ...
5 Nov 2018 by 1suli0
Well, after a few hours of googling, I still can't find an answer, not even partial one. Is this even possible, or it must be custom solution? What I have tried: I've played around with locked out feature of Identity, but it seems, that is not the answer, because in that scenario user is...
15 Nov 2022 by 2011999
I am installing in my system ASP Netcore 3.1 but unable to get this name space netcoreapp3.1 What I have tried: but show in intelligence in this namespace using Microsoft.Extensions.Hosting.Internal; ...
23 Nov 2022 by 2011999
Payroll is Main Menu. and New Pay and Payment records of Sub menus. Payroll New Pay Payment Records When i am Click Payroll. not show the submenu's How can i get the Payroll of the submenus. What I have tried: ...
29 May 2019 by 855
Create ASP.NET Core 2.2 Web Application(MVC) with Individual User Accounts. In the _LoginPartial.cshtml file, there are something like this: But there is no AccountController,the project only...
29 May 2019 by 855
I created a signalr service on Azure. I'm trying to connect it from C# client. Below is the code sample i found, something i don't understand is when Azure SignalR already used(app.UseAzureSignalR), why map it to a local Hub(Chat)? will the Chat.cs be hosted on azure? startup.cs...
16 Sep 2017 by @sof-mckoy
Step-by-step tutorial on integrating projects created using angular-cli and dotnet-cli
19 Jan 2022 by _Asif_
Its not that difficult. Approach could be like * HashMap filterMaps = new HashMap() * for each column (Id, Age, sex, group, etc) filterMap["Id"] = 001 filterMap["Age"] = 12 * ArrayList list = new...
7 Jul 2023 by A Belal
I want to create invoice Error Is An unhandled exception occurred while processing the request. SqlException: Incorrect syntax near '/'. Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, bool breakConnection, Action...
10 Jul 2023 by A Belal
paid and remain Amount always saved null in database although i get value is not null by javascript What I have tried: my storedProcedure USE [OnlineMarket] GO /****** Object: StoredProcedure [dbo].[InsertintoSalesInvoice] Script Date:...
12 Sep 2023 by A Belal
Error An unhandled exception occurred while processing the request. ArgumentNullException: Value cannot be null. (Parameter 'items') Microsoft.AspNetCore.Mvc.Rendering.MultiSelectList..ctor(IEnumerable items, string dataValueField, string...
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...
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...
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...
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,...
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...
22 Aug 2020 by ABAKh
I want to create Asp.net Core MVC multilingual Project, first i want to do the Multilingual Part, I'm going to do the project with Asp.net Core(MVC) 2019 and SQL Server 2016, so any help will be appreciated. Thank you, What I have tried: I...
3 Nov 2020 by ABAKh
I want to change the direction of the solution (RTL And LTR) when i selected the Language DropDown in (ASP.Net Core MVC) and i'm using BootStrap 3.3.7 for the design, i searched a lot but i didn't find proper solution, any help is appriciated. ...
27 Feb 2017 by abdul subhan mohammed
Dear All,I have a list of candidates and i'm using "Previous" and "Next" button to view candidates.But for last page, i want to disable "Next" button.And i dont want to use/create new variable/member as "Total No. of Records".What I have tried:private void...
27 Feb 2017 by abdul subhan mohammed
private void ValidatePagination() { if (grdCandidate.Items.Count
7 Apr 2018 by abdul subhan mohammed
Dear All, I have Winform application where i have to display some html code for which, i'm using htmlLabel. I want to display ordered/unordered list with Arabic text. The htmlLabel is displaying the list with Arabic which is aligned to right also, but, the bullets are coming on left and text...
7 May 2018 by abdul subhan mohammed
Dear All, I have an ASP.NET web application in C#. I want to import data from excel to Repeater using linq. The excel file contains company logo(Image), empty rows and multiple table with column names and row names. Example: ...
23 Nov 2018 by abdul subhan mohammed
Dear All, I have a List and i'm appling GroupBy, Orderby & ThenBy using LINQ-C#. When i change the requestDate and remarks i'm getting the following erro. At least one object must implement IComparable. Description: An unhandled exception occurred during the execution of the current web...
23 Nov 2018 by abdul subhan mohammed
I got it! IEnumerable candidateRefundVoucherList = requestVouchers; var refundVouchers = candidateRefundVoucherList.OrderByDescending(d => d.RequestDate). GroupBy(r => r.RequestDate).Select(item => new { ID =...
4 Feb 2019 by abdul subhan mohammed
Dear All, I have win-form application. I want to prevent a closing application from the taskbar. I have added a button to close the application, the user should close the application by using this button only. What I have tried: I tried disabling mouse right click, but I don't think it a...
20 Feb 2019 by abdul subhan mohammed
Dear All, I have one windows application where I want to play audio/videos files. First of all, I have added the reference to the WindowsMediaPlay in Com tab in my project solution. I have then added this as the tool by right-clicking in the menu tool and selected the WindowsMediaPlayer. What...
9 Apr 2019 by abdul subhan mohammed
Dear All, I have a web application. The requirement is to upload the data using excel sheet with attachments. What I have tried: I have already completed upload data from excel sheet but I'm not able to upload the attachments files. Example data:...
4 Oct 2022 by Abdulmajeed Alotaibi
Hello , I have quiz Project And I Created a view for the candidate to start the exam , the Questions And Answers Loaded Correctly but when I check Answer for First Question and Select the answer in the Next Question the first question reset ,...
23 Jul 2018 by Abhi1 Kanobi
I am trying to read a XML file from a URL and below is my code in .net core var url = "https://some.com/feeds/newfile.xml"; var httpClient = new HttpClient(); var result = httpClient.GetAsync(url).Result; var stream =...
12 Sep 2017 by Abhimaan Sharma
I tried to all the possible solutions, but code is not working. Getting same error again and again. Infact, I've installed the same from below link: https://www.microsoft.com/en-us/download/details.aspx?id=13255 What I have tried: string ExcelContentType = "application/vnd.ms-excel"; ...
21 Mar 2017 by abhishek_singh
Hi,I have created a web api service with window authentication for Intranet users in ASP.NET Core, Authentication on service is working properly except that it accept all domain user which have valid credentials for requested machine, I just want that it validate for single domain users only,...
9 Jan 2022 by Abuamer
i am making a web application with Blazer and i used radzen Sidebar instead of defulat sidebar but the problem is that i my navmenue is not resposive.is that any way to fix this problem. and that is my code What I have tried: that is the code...
20 Sep 2022 by Achraf Dahdah
Introducing FOREIGN KEY constraint 'FK_books_subCategories_SubCategoryId' on table 'books' may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints. Could not create...
12 Aug 2019 by adhikar patil
Hello, I have two tables - Student Table and Student address table and this tables having relation one to one and I want to write an Get and Put API for those two tables for fetching and updating data using Asp.Net Core with ViewModels. Student Table Columns- ...
11 Oct 2019 by adhikar patil
Hello, I want to read json file data with specific json object array one by one using Foreach loop and insert into database in Asp.net Core. I Have MasterData.json file { "M203StructureKind": [ { "Code": "1", "Description": "BRIDGE" }, { "Code": "2", "Description": "CULVERT" }, {...
15 Oct 2019 by adhikar patil
Hello, I want to read json file data with specific json object array and insert bulk data into database in Asp.net Core. I have two tables in Databse like naming as M203StructureKind, FlhDivision CREATE TABLE [dbo].[M203StructureKind]( [Id] [int] IDENTITY(1,1) NOT NULL, [Code]...
17 Oct 2019 by adhikar patil
Hello, I want to convert Json object to DataTable. I have json file to insert bulk data into table using SqlBulkCopy string contentRootPath = _appSettings.MasterJsonPath; var folderDetails = Path.Combine(Directory.GetCurrentDirectory(),$"wwwroot\\{"MasterData\\masterdata.json"}"); ...
6 Jun 2021 by aditya pewekar
Custom component to handle checkbox after confirmation modal popup
6 Jun 2017 by Adityakumar2318
Hello All, I have a html responsive template. I want to use that template with Asp.NetMVC5. Now i have two option to use that template. 1) With empty MVC Template(I would not get any folder) 2) With ready made MVC Template (After choosing this, i will get Model folder, View Folder and...
18 Aug 2018 by Adityakumar2318
I am trying to log the error in database using log4Net in Asp.Net Core 2.0 but it seems that log4Net is not fully supportable till now. I have checked it on official site(log4net[^]) too. What I have tried: Log4net for .Net Core 2.0 – Rizk Hanna[^] I have tried above link and its writing the...
25 Feb 2020 by ADOConnection
How ASP.NET Core Razor turns templates into assemblies and runs them
21 Feb 2019 by afagh
I am using asp.net MVC core and I am going to read data from SQL in kendo drop-down list. I have installed Newtonsoft.Json library too. I see drop-down list but I can't load data in my drop-down list. my code is as below: What I have tried: my model is located in models>Airports.cs: ...
31 Dec 2016 by Afzaal Ahmad Zeeshan
You can also "not" import anything at all, and use dynamic types to get the values. Most of the times when you have no idea about the schema implementations on the server, then you can easily use these types instead of mimicking the types. I wrote an article about JSON with C#, there this...
4 Mar 2017 by Afzaal Ahmad Zeeshan
AWS Lambdas are functions, not virtual machines to host a full application. The purpose of a Lambda is similar to a serverless architecture. Which means, you only write a single function there. Be it in C++, Python, C#, JavaScript or any other interpreted language that can be used there — C# can...
14 Apr 2017 by Afzaal Ahmad Zeeshan
No one is interested in paying for a full featured team to create an API for every particular platform — I am an ASP.NET Core developer, and I hate the fact that there are very less frameworks and APIs available to get things working. However, since there is no such library, what you need to...
28 Jun 2017 by Afzaal Ahmad Zeeshan
There are several reasons why it would be blank, first thing to make sure of is, the session variable, always check its value before doing anything. if(Session["UserEmail"] != null) { string id1 = Convert.ToString(Session["UserEmail"]); // Continue } else { // Do not load anything,...
19 Aug 2017 by Afzaal Ahmad Zeeshan
.NET Core 2.0 brings a lot of improvements to the system, and it brings a lot of pain to the developers as well. I had a lot of problems upgrading .NET Core 1.x apps to .NET Core 2.0; I yet have to feel the promise it makes about performance and so, but let us see how to upgrade our existing applica
31 Dec 2017 by Afzaal Ahmad Zeeshan
I believe so that you missed when the .NET Core 1.x was upgraded to .NET Core 2.0. For example, if you move ahead and check the existence of CookieAuthenticationOptions, you will not find it because it was removed. You need to change your code and then rebuild it. Read my article that I have...
1 Jul 2018 by Afzaal Ahmad Zeeshan
Overview of what DevOps has to offer and how you can kickstart your DevOps chains on Microsoft Azure
13 May 2018 by Afzaal Ahmad Zeeshan
I currently have an application hosted that was built using ASP.NET Core 2.0, and that used the following NuGet package, GitHub - uhaciogullari/SimpleMvcSitemap: A simple library for creating sitemap files inside ASP.NET MVC and ASP.NET Core MVC applications[^], it was more than enough for me. ...
16 Feb 2019 by Afzaal Ahmad Zeeshan
As already mentioned in Solution 1, by MadMyche, you cannot simply convert your applications to an API, where API itself is a separate way or method of development of applications. An API has so many requirements, such as being stateless, headless, and cross-platform, and cross-device. APIs work...
16 Feb 2019 by Afzaal Ahmad Zeeshan
Apart from what Solution 1 tells, I have to recommend another approach. That approach is, to use string as the ID field in Entity Framework Core, and framework will automatically use Guid to generate the unique IDs. I have always used this, and this lets me sleep peacefully at night. Make the...
16 Nov 2019 by Afzaal Ahmad Zeeshan
This is quite unclear to me as to why you would not want to use Entity Framework, but would still want to use ADO.NET. The only help that Entity Framework provides is that it performs the underlying SQL for you, anyways. Maybe this might help you, ASP.NET Core Identity Without Entity Framework...
31 Mar 2020 by Afzaal Ahmad Zeeshan
A QA is not well suited for such kind of questions, as they require a longer post (a technical blog/article) to answer properly. These two concepts are not new, and they are not specific to Kubernetes or containers. Symlinks are used to link...
8 Jan 2021 by Afzaal Ahmad Zeeshan
Quote: Why I can't upload an image to wwwroot folder? First of all, why would you want to have a web browser upload files to your wwwroot folder? That is one of the highest security loopholes that I can think of. Quote: But nothing happens....
31 Mar 2021 by Afzaal Ahmad Zeeshan
Normally, if you are parsing the string values to integers the best approach is to handle when a string is not an integer. So, instead of: Convert.ToInt32(ViewBag.stripeTotal) I would recommend that you do: int amount = 0; if...
14 May 2020 by agha.r
Can anyone tell me How to create a Site map in .net core 2 ? What I have tried: this article not working in core 2.
29 Nov 2022 by ahmadamiri
hi everybody whats the cause and solution of the following error? InvalidOperationException: The value of 'Author_Book.BookID' is unknown when attempting to save changes. This is because the property is also part of a foreign key for which the...
29 Aug 2018 by Ahmed Dabas
I study asp.net core , and i wnat to view create form and list of details in the same view page For Example: if i have two tables (Department - Employee) , in the department Index view when i click details button the controller will redirect to details view , i want the update details view to be...
9 Dec 2016 by ahmed_sa
I have model calender as following : [Table("Calender")] public partial class Calender { public Calender() { this.schedule = new List(); } [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [Key] ...
22 Dec 2018 by ahmed_sa
How to get English text of label from database based on table reference and field name as dynamic... I make project in SQL server 2012 asp.net core 2.1 visualstudio2017 and technology i using entity framework core 2.1 . what I need is to get text of label control from database based on table...
29 Dec 2018 by ahmed_sa
how to use repeated get data from table from one place by using general function take table name. Problem: i use repeated more statement to get data actually i need to call it from one place if possible but cannot do that. so that i will not go every controller and repeat get data from...
29 Dec 2018 by ahmed_sa
Problem How to use entity framework with database tables that not have primary key. i have old database made by SQL server 2012 i get requirement to work as entity framework technique and mvc . i suddenly found that more tables not have primary keys and no relation ship between some tables...
7 Jan 2019 by ahmed_sa
Problem How to use save button in Create Action to make save in both cases insert and update using repository pattern ? and what changes i will make in view to accept update and insert . what i writing is when make new record or update record then use save button it will save using create...
6 Jan 2019 by ahmed_sa
I have controller name emp have action add i need when action add view loaded display last value increased by one in employeeid textbox meaning suppose i have in datbase employeeid 1 then when action add view loaded employeeid must have 2 so that how to do that please ? in action what i write ...
7 Jan 2019 by ahmed_sa
Problem When display next record of EmployeeId i get error on line below : Next NullReferenceException: Object reference not set to an instance of an...
7 Jan 2019 by ahmed_sa
when try to convert nextid to integer to assign to employeeid i get error as below System.InvalidCastException: 'Unable to cast object of type 'Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[System.Int32]' to type 'System.IConvertible'.' employee id is integer and error show on...
12 Feb 2023 by ahmed_sa
I have application work in asp.net core 2.1 visual studio 2017 work with angular but when run page it show empty page i make inspect inside web page i get error as below Uncaught Error: inject() must be called from an injection context at injectInjectorOnly (core.js:1188) at inject...
18 Jan 2019 by ahmed_sa
Problem i work on asp.net core 2.1 visual studio 2017 code first with repository pattern when do create database i do as following Add-Migration InitialCreate but i got error Entity type 'Employee' has composite primary key defined with data annotations. To set composite primary key, use...
16 Jan 2019 by ahmed_sa
Problem How to implement repository pattern in asp.net core 2.1 visual studio 2017 with SQL server 2012 ? i work on project work on repository pattern but i cannot implement it 1- How to define repository on controller Employee to call function GetAll on constructor? meaning how to...