Most voted "asp.net-core" questions
ASP.NET Core is a Microsoft framework as a redesign of ASP.NET.
Learn more…663 questions
Sort by count of
-
1
votes0
answers18
viewsAuthenticate with Identity and/or Azure AD
Today the client application authenticates using Identity (.net core 3.1), however I am trying to authenticate also by Azure AD, adding an extra button on the login page where the user can login to…
-
0
votes1
answer50
viewsPrint the absolute url in an Aspnetcore view
I’m starting to work with Aspnetcore, and I’m having a hard time printing the absolute url of my project. I come from PHP and look for something similar to the code below, written in PHP: <?php…
asp.net-coreasked 8 years, 1 month ago LeandroLuk 4,989 -
0
votes1
answer222
viewsCommand "dotnet run" too slow
When I execute the command dotnet run via the command line in my ASP.NET Core project I have to wait 8 to 10 seconds until I can access the browser to test any changes. I downloaded Visual Studio…
-
0
votes1
answer55
viewsView coding
I’m having trouble setting the encoding of a page I did on ASP.NET Core (keeps appearing ? in letters with accents). Us MVC you used to do the configuration on web config. of the project, but now…
-
0
votes0
answers32
viewsDebug . net core application in Docker in windows 7
I need to generate an application in a Docker container, but my computer has windows 7 OS. I installed Docker Toolbox, and inside the bash itself I can run hello world container, but visual studio…
visual-studio debug docker asp.net-core visual-studio-2017asked 7 years, 4 months ago Weslley Rocha 169 -
0
votes1
answer98
viewsQuery $ajax "GET" showing "Undefined"
Good night, my friends! I have no programming experience, I appreciate any help. I created a simple query to list the query in a table. <script type="text/javascript">…
-
0
votes1
answer36
viewsWhat class is similar to Aescryptoserviceprovider in . NET Core?
I am migrating an application to . net core and need to use the AesCryptoServiceProvider, that worked perfectly in other versions of . NET Framework. But when using on . NET Core Visual Studio warns…
-
0
votes1
answer134
viewsForeach on Razor with Many to Many Relationship Model in Entity Framework Core
I have a table of funcionário and a table of projeto related to many to many as shows diagram below: At the controller FuncionariosController in the method Detalhes i want to list the list of…
-
0
votes1
answer142
viewsRestapi aspnet core error 400
I am trying to consume a third party webservice in my controller, but I need to do an authentication with username and password and pass another parameter in the POST but in every way I did returns…
asp.net-coreasked 8 years ago Diogo Soares 158 -
0
votes1
answer1535
viewsDate format problem (mm/dd/yyyy)
I have an ASP.NET Core application and can’t find a solution to my date format problem. My application, is published on a Microsoft Azure server, which is probably in the US (although it appears…
-
0
votes1
answer1213
viewsHow to use Asp net core 2 in the visual studio 2015 community?
I installed . NET Core 2.0, but when I create a new project in Visual Studio 2015 there is no option to choose Asp net core 2.0. It can be used in VS 2015?
-
0
votes0
answers559
viewsError creating controller using Entity
In my Employee Registration project I have the following folders: MODEL CONTROLLERS DAL VIEWS From the moment I create a controller using the Entity that already creates me right my view he makes…
-
0
votes1
answer934
viewsHow to send a post to an Aspnetcore API without converting the data using Json.Stringify
Hello, I’m starting to work with ASPNET Core and there’s a problem in working logic that I can’t accept (I understand as a really dumb thought). Let’s go to the examples: NOTE: in all tests I am…
asp.net-coreasked 7 years, 6 months ago LeandroLuk 4,989 -
0
votes1
answer58
viewsHow do I mount a List or Ienumerable array in the Controller and move to View?
Good evening! I made a request to my webapi to search for data to use=it in a DropDownlist @Html.DropDownList("Id","Descricao"). In My controller, I can pull Webapi results in collection, I treated…
-
0
votes0
answers263
viewsDoubt in html. Viewbag-powered dropdownlist
I’m having the following problem: I need to send instead of the Id of ViewBag, the Municipio, which is contained in ViewBag.Cidades. How Do I Switch from Id to Municipio when I click Search to send…
-
0
votes0
answers43
viewsHow to get application settings in static classes in Aspnet Core 1.1
In my application’s web project I have the appsettings.json: { "Foo": "Exemplo" }, And I have a class that reflects that configuration: public class FooSettings { public string Foo { get; set; } }…
-
0
votes1
answer288
viewsApi receiving date with changed month and day
I have a class: public class Filtros{ public DateTime DataInicial { get; set; } public DateTime DataFinal { get; set; } //outros campos... } I have a C# API that takes the class:…
-
0
votes0
answers54
viewsProblems running Javascript Asp.net core
I copied some folders containing css scripts and javascript for wwwroot these files are being referenced in my Shared/_layout. A message appears in the upper corner of my Visual studio 2017 window:…
-
0
votes1
answer1295
viewsInvalidoperationexception: Cannot create a Dbset for 'Applicationuser' because this type is not included in the model for the context
I already have a database created in Sql Server, so I executed command: PM> Scaffold-DbContext "Server=(localdb)\mssqllocaldb;Database=Teste;Trusted_Connection=True;"…
-
0
votes1
answer284
viewsDifference between Addmvc vs Addmvccore
In some examples I’ve been following, I’ve found two calls on Startup of applications in asp.net-core Addmvc: public void ConfigureServices(IServiceCollection services) { services.AddMvc() }…
-
0
votes1
answer67
viewsTotable method is not recognized
Contextualization I am starting in ASP.Net CORE and, to consolidate the knowledge, I am trying to make a small project already using this framework. However, I am having trouble mapping my domain…
-
0
votes0
answers94
viewsWhat is the best approach currently to handle user permissions in ASP.NET Core?
I am currently working on a project with aspnet-core and do not have much idea how to proceed to handle user permissions. I even have an idea of how I can do it (and I’ve done it), but I don’t know…
-
0
votes1
answer54
viewsUse Identity with existing database
I am migrating from a system to Asp core, but the system currently has its login logic made in the previous one, my question is the following, is it possible to use only the authorization of…
-
0
votes1
answer249
viewsError while trying to create a Controller or Apicontroller
I created an empty Asp.Net Core 2.0 project (no scaffold). DDD model and etc. However when I try to create my controller, whether inherited from Apicontroller or Controller, it gives error:…
-
0
votes2
answers544
viewsASP.NET Core Attribute routing
I’m migrating a project to ASP.NET Core 2.0, but I’m unable to use the following routes. Error message. An unhandled Exception occurred while Processing the request. Ambiguousactionexception:…
-
0
votes1
answer325
viewsSort a list of objects by a string list
I’d like to serve Getall already brought the list of posts in order according to the list of Ids passed by the parameter module. Higlights List<Post> posts = new List<Post>(); var posts…
-
0
votes0
answers46
viewsError while trying to create a view from a controller and model
When trying to create a View from the Controller, using Asp.Net Core 2.0 Web Api, I have this error. It only happens when I do: 1) Template -> List 2) Model class -> when I search the Model…
-
0
votes2
answers112
viewsHow to add a built-in view to an Asp.net core 2.0 controller
I created a view (Razor Page) in an Asp.Net Core 2.0 project. How I build it from scratch and I now need to assign a controller to it. How do I do it?
-
0
votes1
answer380
viewsHow do I hide or clear the url when I get Asp.net mvc?
I wanted to know how to clean or hide data that I pass through a URL to a webapi so that the data n become apparent and do not disturb my routes.. following example:…
-
0
votes1
answer491
viewsHow to display messages (Summay) to the user in the Index view
I have a View Index and via the Create view is opened in a modal form from it. When I open the Create modal, I fill in the fields and click on the save button the modal remains open and Summary…
-
0
votes1
answer332
viewsHow to make an Event Change in ASP.NET Core MVC?
In ASP.NET we have the Event Change right in the Code Be-hind protected void ddlCiclo_SelectedIndexChanged(object sender, EventArgs e) { //algo aqui } What would be the equivalent in ASP.NET Core…
-
0
votes1
answer43
viewsConversion of Types with Fluenti API to EF Core 2.1
I would like to know if it is possible to make the following conversion: public class Pessoa { public bool Ativo { get; set; } } public class PessoaMap: IEntityTypeConfiguration<Pessoa> {…
c# asp.net-mvc asp.net-core code-first entity-framework-coreasked 6 years, 3 months ago Nicola Bogar 123 -
0
votes1
answer103
viewsApi gets date with changed month and day if parameter is sent by url
I have an api that gets a date (the date is sent as string and received as Datetime): [HttpPost("ObterDados")] public JsonResult ObterDados(DateTime data) { //codigo if I post with the parameter in…
-
0
votes1
answer786
viewsError Saving Data - Nullreferenceexception: Object Reference not set to an instance of an Object
I am trying to save data which pulls a list of a Ienumerable, however while always saving from the error below. When consulting the database, the data were saved correcting, but always give the…
-
0
votes2
answers107
viewsCode-First Fluent API with complex classes in ASP.NET Core 2.1
Error while performing the Add-Migration when using Complextype classes. public class Cliente : EntityBase { public Cliente() { #region Create HashSet Properties Lists Dependences Titulares = new…
c# asp.net asp.net-core fluent-api entity-framework-coreasked 6 years, 3 months ago Nicola Bogar 123 -
0
votes2
answers228
viewsJson Web Token - How to create a token that accesses only a particular Controller or Action?
I am implementing JWT in a. Net Core 2.0 application and would like to know how to restrict token access to certain controllers.
-
0
votes1
answer364
viewsProblems with Findsystemtimezonebyid in Web.API . NET Core in Docker (Linux)
Setting: I am migrating a Webapi to . NET Core, on Windows is running normally. Problem When I am running on Docker (Linux) (Docker-Compose) I am having the following problem: "The time zone ID 'W.…
-
0
votes1
answer296
viewsQuotation marks exiting in incorrect JSON format!
I’m creating a dictionary for JSON on Razor Pages, but the quotation marks ("), are coming out as " _Layout.cshtml (UTF-8) ... <body> ... <script type="application/ld+json">…
-
0
votes0
answers34
viewsError Request Mail
Could someone give me a hand here? I’m doing an environment check to send a certain email, only the following error is occurring. Could you tell me how to fix this? My code is below public void…
-
0
votes1
answer58
viewsImprove routes
Do people have a better way to do these routes? Or for every action in my Controller I’ll have to create your routing? app.UseMvc(routes => { routes.MapRoute( "Login", "Login", new { controller =…
-
0
votes1
answer88
viewsError running Add-Migration Setup
When executing the command Add-Migration Setup for the creation of the table in SQL Server in PM the message below occurs even if I reference the api project with Shared. The system even processes…
-
0
votes0
answers214
viewsUpload Image and save to Asp.net server
Friends could help me create a function to record the path + image name in the database, and save the image on my server ? I’m using the field model.PhotoName which is a string to store the path,…
-
0
votes1
answer220
viewsGet the value of custom attributes in aspnet-Identity . NET CORE 2.0
I’m using the Identity with aspnet core 2.0 and I needed to add the attribute nuCPF on the table Applicationuser. In the controller I am getting the user data as follows: [Controller:…
-
0
votes0
answers345
viewsDigital certified in ASP.NET Core 2.0
I have a project in ASP.NET Core 2.0 where I am generating PDF contracts, however, I need to sign them with the company’s A1 digital certificate, only this part is missing to finish the project.…
-
0
votes1
answer44
viewsHow to return a message warning that there is already a record?
I have a method in Cepcontroller Register that before making the registration makes some validations and between them, checks if there is already registration for that Zip Code. I would like to…
-
0
votes1
answer678
viewsProblems referencing Javascript and css files - Asp.net Core
I’m trying to adapt a layout model that I found on the net, in my Asp.net core, but I’m not being able to make it work.... I created a Content folder at the root of the project and within it I have…
-
0
votes1
answer244
viewsPersonal Field Login to Identity
Personal A doubt that however seemingly silly I did not find in any article that talks about Identity. How can I customize authentication features to use email as the user name instead of using…
-
0
votes1
answer175
viewsHow to configure user downtime in Asp.Net Core?
I started studying Asp.Net Core these days, I’m working with version 2.1. I can already log in and log out of the user, only I don’t know how to set his downtime. I put this code, but after a few…
-
0
votes1
answer123
viewsImplementarr Asp.net core Identity 2.1 in a databasefirst project with two contexts
I am encountering a problem. Below I have performed the following steps: 1) I created an Asp.net core web Aplication MVC project without authentication (Asp.net core 2.2). 2) Because I already have…
asp.net-coreasked 5 years, 8 months ago Hugo 39 -
0
votes0
answers361
viewsProblems with Javascript accentuation - Asp.net Core
Every text I write in Portuguese on buttons, etc, gets problems of accentuation in javascript. What I need to do? //Trecho do meu arquivo _Layout <!DOCTYPE html> <html class="no-js…