Questions tagged [asp.net-mvc]

The ASP.NET MVC Framework is an open source web application framework and tooling that implements a version of the model-view-controller (MVC) pattern tailored towards web applications and built upon an ASP.NET technology foundation.

Filter by
Sorted by
Tagged with
0 votes
1 answer
95 views

System.UnauthorizedAccessException: 'Access to the path '*****' is denied.'

public IActionResult Upsert(ProductVM productVM,IFormFile? file) { if (ModelState.IsValid) { string wwwwRootPath = _webHostEnvironment.WebRootPath; if(file!=null) { ...
Ashwin Gholkar's user avatar
0 votes
1 answer
76 views

ASP.NET MVC how to send bind object along with an array?

I'm creating an ASP.NET MVC project with Entity Framework I have 2 models: ModelA (string name, ICollection list) ModelB (int days) Is there any way I can send an array of JSON (or better yet, the ...
Eduardo H Anacleto's user avatar
0 votes
0 answers
31 views

ASP.NET MVC controller parameters for file and user

I am trying to receive a post from my file route containing the following (I have censored the content): File: (binary) Cells: C1:C25 User: {"Id":"10833556063478680686586","...
David Aslan's user avatar
1 vote
1 answer
35 views

Why is my property showing validations even If I didn't explicitly put any [Required] attribute on it?

Why is my model property doing validation for [Required] even I did not explicitly put any of it in my model class? In the forms in front-end if I left the MiddleName input blank or untouched it shows ...
John Phillip Abello's user avatar
-1 votes
1 answer
36 views

"InvalidOperationException:" While trying to save a many to many relationship to database

First of all, i just wanna say i'm a total newbie with asp .net core mvc, and entity framework, soo i don't really know if i'm doing this right or in the best way. I'm trying to do a simple program ...
Mateus Fernandes Vailate's user avatar
1 vote
0 answers
11 views

Owin OpenId connection with NET Framework - error IDX21323

I have a problemi with my .net Framework 7.4.2 Project. Now i'm using the project using ADFS connection using Owin+Identitymodel Packeges. I added the new autentication method using Owin openid to ...
Andrea Porcello's user avatar
0 votes
0 answers
16 views

Invalidating session state for certain conditions

I am working on an older ASP.NET MVC4 codebase to make some adjustments. I noticed that the application loads an object on each request with information about the user and their billing status. I'd ...
Alex's user avatar
  • 1,576
0 votes
0 answers
27 views

Apply loader on "Select All" functionality of SumoSelect library

I am using sumoselect.js for my dropdowns. and i also have loader implemented in my project with id "mainloader". Now i want when user click on select all then loader should show i.e $('#...
Abhay Singh's user avatar
0 votes
0 answers
54 views

I cannot retrieve the name part in the database

I am following a developer but I would like to ask for your help for an issue that I cannot comprehend, when I try to bring the name of the Universities to the University field in my own application, ...
Mehmet's user avatar
  • 23
0 votes
0 answers
21 views

'The user specified as a definer ('mysqladmin'@'%') does not exist' [duplicate]

I have a MVC app connected to a MySQL database. It has been running smoothly for a long time making reading and writing through Entity Framework and also directly by executing SQL-queries. However, I ...
Nielsen's user avatar
  • 25
0 votes
1 answer
56 views

ASP.NET MVC view won't update after model changes

The Radiologists view loads just fine first time you enter, and the dropdown is filled with data. After you select a doctor, the table should display the two values shown in the view, but they won't ...
Diego Perez's user avatar
  • 2,234
0 votes
1 answer
163 views

How to use the dev and prod environment with Azure AD for authentication used by ASP.NET MVC app

I'm working on an old ASP.NET webforms/MVC app and I'm trying to use Azure AD authentication method. It was done with the prod server, but when I want to use localhost or dev server, I added their URL ...
Alexandre's user avatar
1 vote
1 answer
68 views

How to run multiple background tasks at a specific time interval?

I'm developing an application in C# MVC and I want to execute multiple background tasks each at different time intervals. I already have a service that inherits the class BackgroundService. I already ...
Lenny's user avatar
  • 21
0 votes
0 answers
58 views

Developing Full CRUD Operations Using Modal Popup in ASP.NET Core MVC. But output showing "undefined"

I am developing Full CRUD Operations Using Modal Popup in ASP.NET Core MVC. But the output shows "undefined".Where I am wrong? I am giving my code below. I am trying to resolve it but not ...
Mayank Srivastava's user avatar
0 votes
1 answer
38 views

ASP.NET MVC : method not found when two controllers has the same method name

I am writing an ASP.NET MVC app. I have two controllers, Controller1 and Controller2. I have a method called SearchBySSN in my Controller1. I am calling this method via Ajax from the view: $.ajax( ...
Diego's user avatar
  • 2,256
-1 votes
0 answers
18 views

How to get list of point from GraphHopper json route

Yo, so im making an app using the graphhopper api and i have the json returned by the routing api in a string. How can i get a list of the longitude and latitude for each point on the route? im using ...
George Clensy's user avatar
0 votes
2 answers
41 views

How to design a web project using .net core which calls a statefull api

Need inputs to design a web application. The scenario is described below. Would like to develop a web application using .net core the web application will just have the presentation layer meaning the ...
user3048027's user avatar
0 votes
1 answer
32 views

how to enable JavaScript debugging in visual studio 2019 behind .cshtml page

My Visual studio 2019 +, My code is asp.net mvc project, When I pointing on .chtml page behind java script debugging point, its cant working step by step, But when its pointing separate JavaScript ...
Nasir Uddin's user avatar
0 votes
2 answers
75 views

How to invoke a class which has protected constructor for testing its methods in c#?

I have a C# class of the following structure public class ClassA{ protected ClassA(double[] number){ } public double methodofClassA(){ } } I would like to invoke methodofClassA() for ...
Ann's user avatar
  • 137
0 votes
0 answers
37 views

user to logout if browser tab/window is closed after getting idle timeout popup on screen without choosing options to extend /end

onidletimeout.subscribe(=> { if(confirm('your session is expired. Press 'OK' to refresh or 'cancel' to logout')){ this.document.reload(); } else{ this.msalService.logout(); }}); this is the code ...
Sushmitha Hegde's user avatar
0 votes
1 answer
33 views

how to generate default versions swagger collection?

I'm trying to create a versioned swagger using the Asp Versioning Mvc ApiExplorer library. I followed the basic guide documentation and applied the Operation Filter, but even though I specified the ...
Vorasoda's user avatar
0 votes
1 answer
37 views

How to prevent breaking MVC routes when changing the name of a method in a controller

I'm wondering if there is a way to prevent errors that could come from renaming a method inside a Controller of an MVC app. Let's say I have a route defined as routes.MapRoute( name: "...
MuffinTop's user avatar
0 votes
0 answers
24 views

How do I clean session with a onclick button

This might be pretty obvious or stupid question but I have a button that I want it to logout of a session when pressed, but I can't just do <button onclick="@{httpcontext.session.clear();}&...
Baconn's user avatar
  • 1
0 votes
0 answers
11 views

how to type a Value on a dataGrid blazor to update it?

I'm beginner in coding. I try to update the value of stock_quantity of variations displayed in dxGrid. when i enter the new value for some variations it will be stored in local variable then when i ...
Kaouthar Graja's user avatar
-1 votes
0 answers
48 views

controller class not receiving int from manager class

I'm creating a website with a web page that supposed to generate a list of players based on a teamID int field, but the controller is not receiving the data. Manager class public List<Player> ...
IronSaber15's user avatar
1 vote
2 answers
51 views

NullReferenceException after deleting item from database, then redirecting to page showing the list of remaining items

I am getting a System.NullReferenceException: Object reference not set to an instance of an object. when I delete an item from the SQLite database and I redirect to the Index page (which shows the ...
yt10's user avatar
  • 13
0 votes
0 answers
45 views

ASP.NET MVC login popup

I'm new to ASP.NET, I'm working on a project with ASP.NET MVC with a database-first approach to both UI and API-separate solutions. I am trying to run the UI solution and noticed that login pop-up, ...
Jana's user avatar
  • 9
0 votes
1 answer
28 views

kendo scrollview as clientTemplate doesnt work when providing it a template

I am working on a page of a website using Kendo ASP.NET MVC. What I need is a table with a detail row. Within that detail row, I require a Kendo ScrollView to display images. When I attempt to use a ...
Daniel Larrad's user avatar
0 votes
2 answers
34 views

Attempting to create a Dynamic or T Type List for common method

I have a scenario where i am building a list of data from some source data. The exact same process is used by another source data so i thought to create a dynamic or List so i can pass in any data ...
KeithViking's user avatar
0 votes
0 answers
75 views

sp_executesql in stored procedure

I created a stored procedure in the SQL Server database. Since it will search from a different table according to the entered value, it searches for that table name according to the variable and scans ...
Kadir Çolak's user avatar
-1 votes
0 answers
35 views

Dynamically loaded Carousel not working - MVC

The html is loaded dynamically from the Controller - if I paste the loaded html onto a page it works just fine. View <div id="IndexCarousel" class="carousel slide" data-bs-...
gchq's user avatar
  • 1,615
-1 votes
3 answers
130 views

.NET Entity Framework custom user table and column error

I'm trying to use my own tables for storing the users of my .NET 4.8.1 Entity Framework app. I have this application user model: namespace GesTalento.Models { // https://go.microsoft.com/fwlink/?...
Jaime02's user avatar
  • 216
0 votes
0 answers
26 views

'httpcontext does not contain a definition for current' ASP .Net Core [duplicate]

I have problem with this code below. Its say "httpcontext does not contain a definition for current". public static string GetIpAddress() { string ipAddress; try { ipAddress = ...
Quốc Võ's user avatar
0 votes
0 answers
18 views

ASP.NET MVC app: "An error occurred while processing your request"

I deployed an ASP.NET MVC web application to AWS. The application requires me to log in and immediately I try to log in I get this error: I don't understand how to change this to developer mode. Also ...
Orezioghene's user avatar
0 votes
0 answers
22 views

HttpSessionStateBase Session in ASP.NET MVC is null when accessing site from an iframe

I am setting a few variables up when the page loads. Example: UserId. I then access this data later by using Session["UserId"] and this works when I load the page by itself. However, when I ...
Scott Anderson's user avatar
1 vote
1 answer
97 views

403 error in .net core mvc web hook endpoint requests

After the payment process, the stripe web hook endpoint is triggered, but I get a 403 forbidden error. How can I allow requests from Stripe API to some IP addresses in .Net Core MVC? Note: stripe ip ...
Ömer Akkuş's user avatar
0 votes
1 answer
36 views

How to upload the file into HttpFileCollection in C# Unit Test

var httpRequest = HttpContext.Current.Request; if (httpRequest.Files.Count > 0) { var postedFile = httpRequest.Files[0]; I want to upload the file to HttpFileCollection in unit test MVC C#, ...
karthick S's user avatar
0 votes
0 answers
14 views

ASP.NET MVC List show Action link based on field value

I have a view with a html.displayfor(function(modelitem) item.submissionstatus). Is it possible to just show the action links Edit / Details / Delete based on the value returned. ie if the returned ...
PeteN's user avatar
  • 15
0 votes
2 answers
47 views

Always Getting Null Values when calling the function GetAllUsers() while making Authentication controller in MVC

I'm always getting NULL when calling the function GetAllUsers(). I'm trying to write an authentication controller in ASP.NET MVC. This is the AuthController: public class AuthController : Controller { ...
kareemDev's user avatar
0 votes
0 answers
46 views

microsoft.clearscript.v8 in use promise but this code in error return

In this code I am using microsoft.clearscript.v8 library in c# (asp .net core mvc) how to solve this error '((Microsoft.ClearScript.ScriptItem)promiseResult).UnderlyingSystemType' threw an exception ...
NamanGajjar's user avatar
0 votes
0 answers
27 views

Microsoft.owin.testing registering IHttpModule

I have an IHttpModule responsible for appending data to a header. While working on component tests using Microsoft.Owin.Testing, I'm facing challenges registering my module. I intend to write a test ...
James's user avatar
  • 17
0 votes
1 answer
50 views

Passing return url form the form

I am trying to pass the value of the return url from the view with the form element to its action method inside of the respective controller. In the action method, I am doing the server side ...
Goga Gate's user avatar
0 votes
0 answers
23 views

Automatically generating HTML forms in ASP.NET MVC for dynamic questionnaires

I'm currently working on an ASP.NET MVC application, and I'm looking for a way to automatically generate HTML forms for a dynamic questionnaire. I have a list of over twenty questions, and I want to ...
Polina Karanxha's user avatar
0 votes
0 answers
50 views

Problem in dialing call with Twilio Voice

I've made a back-end call and i want to trasfer it to front end to get the client device. The problem is that whenever i try to call i just get a Twilio voice demo response without being able to dial ...
Giorgio Prizzi's user avatar
1 vote
2 answers
54 views

How to ignore a specific field when updating db entity?

I have a class MessageModel, which has a field public string? AttachedFile My controller adds a message to the database [SwaggerOperation(Summary = "Create Message")] public async ...
Winter Wind's user avatar
1 vote
0 answers
45 views

Lock/Monitor in IActionResult ASP.NET MVC C#

I'm new at .NET world. Currently I'm working on ASP.NET MVC "concept editing-sharing" project and I'm stuck on lock/monitor implementation. I have an IActionResult called EditConcept: [...
gailtye's user avatar
  • 43
1 vote
1 answer
68 views

How to Manage Multiple Database for every Client on same Application on .NET 7 [closed]

I need a suggestion. I have a .Net MVC Application that I want to give to multiple customers. What I want to do is use the same deployed application for every customer. I'm thinking of making multiple ...
Zoraiz's user avatar
  • 23
0 votes
0 answers
33 views

Display data from DB to ajaxToolkit LINE CHART (Ajax control Toolkit v20.1) Using ASP.NET Webform C# (Dissertation Question)

So, I have some data in my database and I want to display them in a Line chart. I am getting 2 errors when using 2 different approaches. Please refer below. Am stuck, please help. In my database I ...
danny's user avatar
  • 9
0 votes
0 answers
30 views

Change boolean in ajax in ASP.NET MVC

I want to write Ajax code for my view so that if I change the the check box, the RegisterSituation of rows that were chosen is changed in database. My model class is: public class OstadCourse { [...
amir's user avatar
  • 3
-1 votes
0 answers
17 views

Entered data resets except for one field in my ASP.NET MVC project

There are several fields to insert data by the user. But when I clicked the create button, all the fields are resetting except one field. how should I fix this problem. And I am fully new to ASP.NET C#...
Kaushi Perera's user avatar