Questions tagged [asp.net-core]

ASP.NET Core is a versatile and collaborative framework that enables the creation of dynamic web applications. This innovative platform offers an open-source, cross-platform solution for developers globally. Feel free to utilize this tag when seeking assistance on any topics related to ASP.NET Core applications. If your inquiry pertains to a particular version of ASP.NET Core, remember to include a specialized version tag for enhanced support and accuracy in responses.

When utilizing ASP.NET Core Razor pages for file uploads and utilizing AJAX Post to send the file to an IFormFile handler, the request

I have a straightforward task that involves uploading a file and using AJAX to post it to the Index page: <input type="file" id="file-selector" accept=".txt"> Here is the corresponding Javascript: const fileSelector ...

Setting up individual dependency paths for each client in npm configuration

When working on an asp.net core project, it is necessary to copy all client files under the approot directory for correct deployment. With jspm, you can easily define a proper directory for client dependencies. However, when using npm, you need to manual ...

Utilizing a JSON object to send data to a C# WebAPI POST endpoint that accepts a parameter of a generic abstract class

I have a generic abstract class that defines the structure of an object to be POSTed to this endpoint. The class is as follows, with an example implementation: public abstract class Animal<T> { public string Name { get; set; } pu ...

show the UI changes using AJAX in the controller method

I need help with returning a view in an action called Ajax. The issue I am facing is that when I return JSON, it works fine, but if I try to return a view, it doesn't navigate to the view because the action was called using AJAX. Action: [Route(&q ...

What is the simplest way to incorporate Vue with Typescript, without the need for a complex build setup?

I've been spending the last couple of days experimenting with my basic ASP.NET Core website set up for Typescript 2.9, but unfortunately, I haven't made much progress. My main goal is to keep the front-end simple, with just single Vue apps on eac ...

The ASP.NET Core 3.0 Web API method consistently encounters null values

I've encountered an issue with my Angular app where it displays a 500 server error. Here are the methods I'm using: /*Product Service*/ addNewProduct(newProduct: Product): Observable<Product> { console.log(newProduct); return this.http.po ...

Automated Integration with Visual Studio Team Services: Empowering ASP.NET Core and Angular 4 Collaboration

I am currently working on an ASP.NET Core web app using Visual Studio 2017, and I am developing an Angular 4 front-end project in Visual Studio Code. The goal is for the Angular 4 project to be integrated with the Core web app, and I need to set up continu ...

Issue with file upload controller in .net core 2.2 and Angular 7: IFormFile always returns null

Despite thorough research and checking other answers, my controller is not receiving any data. Correct API URIs are used and the request does reach the appropriate controller. Unique Angular Snippet: In the component.html file - input field setup <d ...

Steps for setting up a voice and video chat system between VR devices and an Angular frontend

Hello, I am currently developing an application that links VR devices (Unity) with Angular frontends through the transmission of data to an Asp.net Core 3.1 API. The entire connection relies on SignalR Core to send JSON objects. However, a new requirement ...

Deploying a ReactJS application on AWS Elastic Compute Cloud (EC2) with a wildcard SSL

After developing a reactjs app with a .net core web API as the backend, I successfully hosted it on a Windows server using IIS with http. However, when attempting to use a wildcard SSL certificate, an error appeared in the Chrome console: "Failed to loa ...

Actions in ASP Core to automatically install necessary tools for Angular2 before and after publishing, followed by the build

Our .NET Core project utilizes Angular2 as the frontend client, housed in a Frontend directory within our solution. The Frontend directory includes package.json and angular-cli.json to keep frontend separate from the rest of the .NET project. When ng buil ...

The PartialView is currently displaying the entire page instead of just rendering the form

I'm attempting to refresh the partialview exclusively within my modal, following the ajax request. However, upon receiving the response, everything gets refreshed and only the partialview is displayed. Here is the PartialView: @{ var bidModel = new B ...

Sending an array of objects in JavaScript to a controller

I have a dynamic form that I'm trying to submit to my Controller. Instead of sending just a string or an array with data, I need to pass an array of objects using ajax request after building the Javascript Array. The challenge is that when I send only ...

Keywords: <footer>, <aside> not encompassing all aspects of the HTML on the content page

Recently, I have been transitioning my codebase from .NET webform to .NET Core: In the _Layout.cshtml, elements like <hr> and <section> span the entire width (e.g. 100%) of the html page as expected. However, when I insert similar tags in the ...

Developing multi-layered business solutions with Angular front-end that incorporate customized localization in .Net Core Entity MVC is essential for ensuring effective business logic implementation

Help me enhance and refine this code I faced challenges trying to understand and piece together this code (coding isn't my strong suit). Sharing knowledge is important, as encouraged by platforms like StackOverflow. Please help me improve and correct ...

Starting a fresh ABP project using the latest v8 CLI comes with a new feature - when you run the command "abp install-libs", it now automatically generates an

Currently, I am attempting to run ABP on macOS Sonoma using .NET Core 8. Everything seems to be working fine except for the fact that the AuthServer is lacking any styling. I made sure to install npm and yarn with the correct versions, and then executed t ...

Getting started with ASP.NET vNext 1.0.0-rc1-update1 live stream!

We began working on the project in beta 7 and successfully implemented most of the functionality in version 1.0.0-rc1-update1. Our primary authentication method is MVC and we use web API to provide data. The majority of the functionality resides in client- ...

The CORS policy has blocked access to XMLHttpRequest at 'https://saja.smjd.ir/api/Account/login' from the specified origin 'http://**'

I have successfully completed my project using Angular 9 on the frontend and asp.net core 3 on the backend, and deployed it to a server. However, I am facing an issue when trying to obtain or use a token from the server. Access to XMLHttpRequest at 'https: ...

Attempting to integrate information from an external API source

I am struggling with properly formulating a question in order to retrieve relevant search results. I am attempting to extract data from a third-party API (ADP) and store it in my database using asp.net core. My goal is to save the users obtained from the ...

Angular4 ASP.NET Core project does not seem to be detecting the API endpoints

I am encountering an issue with my angular application where I consistently receive a "Cannot match any routes" error when attempting to access certain api resources. The base in my application is configured as <base href="/"> and the api source is ...

Integration of HostConfig with AdaptiveCards

Is there anyone familiar with incorporating a HostConfig to style AdaptiveCards using the webchat CDN in an Asp.Net Core environment? For instance, what should be the name of the file? And where exactly does it need to be placed? The specific setup for ...

Is there a way to establish a connection between my reactjs frontend and ASP.NET Core backend using ngrok?

Having some trouble setting up the connection between my frontend and backend to send and receive data. Can't seem to figure out why it's not working. Here is the configuration in launchsettings.json on the backend: { "iisSettings": { &quo ...

When making a delete request from an Angular application to an ASP.NET Core API using $http.delete, an unsupported media type error

I keep encountering a 415 HTTP error response when attempting to send a request to an aspnetcore API. Interestingly, this issue does not arise if I switch the endpoint from [HttpDelete] to [HttpPost]. Here's a snippet of the controller in the aspnetcore A ...

Editing content directly within an ASP.NET Core MVC application through AJAX encounters a 400 error, indicating a Bad Request

I'm attempting to implement inline editing using AJAX in ASP.NET Core MVC, but I keep receiving a 400 error (Bad Request). The idea is to click on a table row to edit and save the new values in an SQL database. Could someone confirm if I am on the right ...

Webpack encountering issues with loading dependencies within dependencies

When I try to run webpack, it seems that the compiler is having trouble loading my app.module from within main.ts. Without using webpack, my application can find all modules correctly, but with Webpack, it's failing. This is my webpack configuration: ...

Sending detailed exception information from asp.net core to the client (such as Angular)

Trying to retrieve exception text from the backend (ASP.NET Core) in an Angular application has been a challenge. Examples have shown the controller action's return type as either JsonResult or ActionResult. In such cases, we can utilize the following me ...

When executing a Solution in Visual Studio19, npm is not being located

Recently, I started working with Asp.Net Core and Visual Studio for a project. However, I encountered an error that only occurs on my machine when I try to run the Solution. The specific error message is: The command "npm install && npm run bu ...

How can I use Ajax to open views in Asp.net Core 3.1?

Why is the view not being displayed even though there is no error? jQuery : $('#edit_button').on("click", function () { var instance = $('#jstree').jstree("get_selected"); if (instance != 0) ...

ASP.Net Core Razor: Troubleshooting Null JSON Value in Ajax Requests

I am currently using .Net Core Razor for my application and encountering an issue with passing values to the controller when calling the action from Ajax. Below is the script I am using: var table = $('#dataTable').DataTable(); var data = table. ...

Retrieve user roles from OpenID Connect client

Utilizing oidc-client for authentication in my application with Angular and ASP.NET Core 3.1. Is there a way to retrieve the user roles from ASP.NET using oidc client? ...

How can I properly bind a list of objects with nested lists when submitting forms?

Trying to bind a complex object that consists of nested lists of objects poses a challenge. While the data binds to the page successfully with pre-populated content, issues arise when posting the form to the handler method. I can post and bind the parent ...

Develop an integration of NextJS with .Net Core framework

Looking to develop a solution that integrates NextJS on the frontend and .NET6 on the backend within one unified setup for hosting on IIS10. While exploring Visual Studio 2022, I noticed a React template but encountered issues when trying to transition to ...

"Encountering a 500 error on Chrome and Internet Explorer while trying to sign

I am currently working on an ASP.NET Core application that handles identity management through Azure AD B2C using the ASP.Net Core OpenID Connect. The front end is developed using AngularJS 2 with TypeScript. In my Logout function, the user is redirected t ...

What is the reason behind why decimals don't automatically pre-fill like integers do?

Seeking help with an HTML issue - I have a field pre-filled with a decimal number, but it's not displaying the value when loaded. The field should accept both integers and decimals, but only integer values are showing up correctly. I've spent hours resear ...

What is the best way to transmit a JSON object to a .NET server utilizing SignalR?

I am currently in the process of developing an Angular application that requires sending data from Angular forms to an external server using a .NET Core server and SignalR. While I have successfully established a connection between the Angular client and c ...

What causes the parameter to be null when jQuery AJAX sends Content-Type=application/json to an MVC Controller Action method?

Apologies for asking a question that has been addressed multiple times before, but I am unsure if the answers from those discussions are still relevant with the latest versions of ASP.NET Core MVC and jQuery. My MVC controller method accepts a class objec ...

When making a request to a REST API, the JSON parameter is found to

Currently, I am attempting to transmit a URL as content from my client to my web API without encoding it. To achieve this, I have decided to send it in the body as JSON. This is how I am sending the JSON: "{"URL":"https://www.example.c ...

I'm curious, where does Visual Studio create the dist folder when you run an Angular Web Application?

Currently utilizing Visual Studio 2019 Community Edition, although the same situation also pertains to VS2017 and other editions of 2017/2019. While developing/running an ASP.NET Core Web Application with an Angular web project, I'm unable to locate the d ...

Extract data from a JSON object sent from an Angular frontend and process it in a C# ASP.Net

Having trouble creating a new Salesman with Angular and C#. I am collecting user input data in an array (newData) from my Angular controller and sending it to my C# server-side controller through a service. However, I am encountering errors and unable to r ...

Encountered an issue when attempting to deploy ASP.NET Core / Angular app to Azure from Github repository

After creating a default project using dotnet new angular -o Homepage4, I ran the project with dotnet run and everything worked fine. I then saved the project to my GitHub repository. Now, I want to build my Azure site from the GitHub repository. In my Az ...

enhance user interface by dynamically updating progress bar from Razor server

I have implemented a progress bar on one of my razor pages. When I call it using an onclick event, it works perfectly fine. However, the problem arises when I try to get it working from the server side. Below is the code snippet: using Microsof ...

Steps to resolve background image problems

Currently encountering issues with the application where the background image is not showing up behind the login form. This problem arises while using a bootstrap template for the website. Attempted to set the background image in the .main-content div with ...

Guide on how to verify user identities with Azure AD in a Vue.js interface and backend developed with .Net 5

Our team is currently in the process of transitioning from .Net MVC to a Vue.js front-end. We had originally implemented a custom Attribute in our MVC version that utilized Azure AD for user authentication on specific pages. This attribute verified if user ...

Is it necessary to have NodeJs in order to host a React app on a server?

I've been working on a .NET Core 2.2 project with React integration, As I'm nearing completion of the project, I have a query that has been on my mind. Do I need Node.js installed on the server for React to function properly? Thank you. ...

What is the best way to configure a Next.js API route to make a fetch request to an ASP.NET Core API without encountering issues with self-signed certificates?

I am currently in the process of developing a nextjs app that utilizes a .NET core api as its backend. To handle server-side authentication data and obfuscate endpoints, I am using nextjs' built-in api routes as a proxy to the backend. However, I hav ...

How can I remove and rename a jstree node identified by its GUID value in Asp.Net Core 3.1 when a button is clicked?

Below is the code snippet for displaying Category in Razor View: $('#evts_button').on("click", function () { var instance = $('#jstree').jstree(true); instance.deselect_all(); console.log(i ...

An AggregateException has occurred due to multiple errors arising. The main issue revolves around the failure to initiate the 'npm' application. To troubleshoot this problem and resolve it, further actions are

Experiencing frustration with Visual Studio on Mac when using Docker due to numerous errors. The project involves ASP.NET Core 2.1 with Angular 6 on a Docker image. The project builds successfully, but encounters issues when trying to run as detailed below ...

Implementing Angular routing in an ASP.NET Core 2 project

I recently encountered an issue with serving my Angular project within an ASP.NET Core project. After building the Angular app with "ng build --prod" and placing it in the wwwroot directory, I set up the ASP project to serve the site. Since I do not have a ...

What are some best practices for utilizing the same partial view with both ajax and static pages?

Upon a user's initial visit to my website via URL, the controller generates _Layout and partialView. Subsequently, as the user navigates through the site, the controller continues to generate the same partialView, which is then sent via AJAX. Are there a ...

Guide on accessing an anonymous object from BindingContext

Looking to implement custom model binding by creating an implementation for IModelBinder in a .Net Core 2.1 API application. Model class - [ModelBinder(BinderType = typeof(PersonBinder))] public class Person { public name {get;set;} publ ...

A guide on retrieving and resetting the value of a radio button within a table

I need to create multiple radio buttons within a table using Razor syntax under ASP.NET Core MVC. Each row of the table should have an update and clear link to update the record and clear the selected radio button for that specific row. <table class=&qu ...

Is there a way to transfer data from the controller (in JSON format) and display it in a ListBox within the

As a newcomer to ASP.NET Core, my main goal is to easily populate a listbox with data from a JSON file. Take a look at the controller class below: public class EmployeeController : Controller { public IActionResult Index() { return View() ...

Tips for managing multiple VueJS single page applications in ASP.NET Core 3

In my ASP.NET Core Web API application, I am looking to host two VueJS apps - one for Admin and one for Users. To achieve this setup, I have configured it like so: app.Map("/users", adminApp => { adminApp.UseSpa(spa => ...

Should the JSON data in an ASP.NET React application be serialized and normalized on the client-side or server-side?

Currently, I am in the process of developing a asp.net react application. Up until now, I have successfully completed the serialization and normalization of nested data on the client-side using normalizr. However, I am considering whether it would be more ...

TimeoutException occurs in Browser when using Visual Studio with ASP.NET and Angular

After waiting for 60 seconds, an error message appeared in the browser when trying to debug. However, after refreshing the browser window and waiting for another 15 seconds, everything seemed to be working fine. An unexpected error occurred during the r ...

The string returned from the Controller is not recognized as a valid JSON object

When attempting to retrieve a string from a JSON response, I encounter an error: SyntaxError: Unexpected token c in JSON at position In the controller, a GUID is returned as a string from the database: [HttpPost("TransactionOrderId/{id}")] public asyn ...

Unable to submit form upon clicking radio button in .NET Core

Trying to submit a form by clicking on a radio button. The JQuery code used for submitting the form: Form: @for (var item = 0; item < Model.Count(); item++) { <form id="myform" action="xx" controller="xxx" method="post"> ...

Transitioning from a multipage application to Piral: A comprehensive guide

Our organization operates several ASP.NET Core applications that are traditional multipage applications. As we develop a new portal using Piral, we want to incorporate elements from our existing applications while also introducing new modules. How can we ...

Transferring information to a controller using ajax in ASP.NET Core

I am encountering an issue with sending data to the controller through ajax. The value goes as "null". Can someone please assist me with this? Here are my HTML codes: <div class="modal fade" id="sagTikMenuKategoriGuncelleModal" data ...

Ensuring model accuracy in Asp.Net Core prior to initiating an Ajax request via JavaScript

Here is a snippet of code that I am currently using, which is triggered on a button click event. The question I have is regarding the validation of my viewmodel object before sending an ajax call. I can see model errors in JavaScript, but I'm unsure o ...

Extract an array segment from a JSON document and convert it into a list

In my JSON file, there is a valid list/Array of databases structured as follows: { "Logging": { "IncludeScopes": false, "LogLevel": { "Default": "Debug" } }, "settings": { ...

The JSON string fails to deserialize and returns a null value

{ "apple": { "A": "xyz", "B": "abc", "C": "jkl" }, "banana": { "A": "lotus", "B": "oil", "C": &qu ...

Issues with Access-Control-Allow-Origin in .NET Core Deployment on IIS Set up on Windows Server 2016

I have checked various sources like Microsoft Documentation, SO Answers, and even installed IIS CORS module, but I am still struggling to get it right. The issue arises with my .NET Core API 3.1 hosted on IIS at AWS EC2 Windows Server 2016 datacenter, acc ...

Managing authentication during an ajax call from an MVC client to the resource API within Identity Server 4

Authentication in my system is handled by Identity Server 4. One of the client's applications is an Asp.net core MVC Project, which needs to make ajax requests to a web API resource. From certain pages on the MVC client, I need to call the web API re ...

Tips for managing and modifying information with a dropdownlist in asp.net core mvc and angular js

In my asp.net core MVC project, I am incorporating AngularJs to manage two dropdown lists and a textbox. While the textbox functionality for saving and editing data works well, I am facing issues with resetting the dropdown lists after posting data and not ...

What should be the response to send back following an Ajax call in asp.net

Once the ajax call is finished and the model has been successfully posted to the controller, what should be returned by the controller? In this scenario, my intention is simply to add an item to the wishlist without any redirection. ...

I am facing an issue with calling a controller from an HTTP GET request in ASP.Net Core 6 using a Single Page Application (SPA) endpoint

[UNSOLVED] - Seeking help from developers [Issue] As a newcomer to the industry, I apologize for my lack of experience in advance. I am currently facing a challenge with ASP.Net Core 6 and it seems like I am missing something simple, but I can't seem to ...

Looking for ways to locate encoded HTML values in chrome?

Referenced from Microsoft Docs In MVC, the Razor engine automatically encodes all output coming from variables. For example, consider the following razor view: @{ var untrustedInput = "<"123">"; } @untrustedInput In this scenario, ...

Submitting form by double clicking and pressing enter at the same time

When using jQuery Validate to validate forms, I encounter a problem where double-clicking the submit button results in my application making two entries with the same data. This issue also occurs when pressing enter multiple times. Despite researching dif ...

What are the steps for creating and deploying a project that utilizes asp.net core on the server-side and Angular on the client-side

My latest project combines asp.net core 5 and angular 15 technologies for the backend and frontend, respectively. The asp.net core MVC portion of the project is contained in a dedicated folder named serverApi, while the angular part is generated in another ...

Building a .NET Core 3.1 application that integrates SQL Server 2019 Express for managing multiple databases, including a main database dedicated to

I'm currently developing a web application using .NET Core 3.1 and Angular 9. I am curious to know if it is feasible to leverage the internal authentication/authorization system in .NET Core to connect to an "authorization" database. This would allow ...

finding the name of a property in a JSON object

I am working with a class that looks like this: public class Client { [JsonProperty("first_name")] public string FirstName { get; set; } [JsonProperty("last_name")] public string LastName { get; set; } } By using the co ...

Utilizing AJAX with ASP.NET Core for Asynchronous C# Methods

It might seem like a silly question to some, but since ajax is already asynchronous, is there any benefit in creating a method that retrieves data from the database asynchronously? ...

Dynamic Searching in ASP.NET Core MVC Select Component

I need assistance with implementing a dynamic search feature on my Login page. Here's the scenario: When a user enters a username, let's say "Jh" for Jhon, I want to display a select list next to the login form that lists all the usernames from the databas ...

Discovering the ASP.NET Core HTTP response header in an Angular application using an HTTP interceptor

I attempted to create a straightforward app version check system by sending the current server version to the client in the HTTP header. If there's a newer version available, it should trigger a notification for the user to reload the application. Ini ...