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
0answers
3 views

How do I pass a list of models from a table in a view to a controller?

I'm just learning about MVC and a problem I've run into is passing a list of models to a controller. I have AutomationSettingsModel, which contains a list of AutomationMachines. I've successfully ...
0
votes
2answers
19 views

How do I send a message to the view that a duplicate entry exists?

I have some code that is checking for possible duplicate entries. What I'm struggling with is where and what to put to let the user know - probably a modal of some sort, displaying the message that a ...
0
votes
2answers
24 views

MVC Form - long questionnaire

we're in the process of creating a quite long form using MVC, Code First and Entity Framework 6. I could use a suggestion on how to structure the form/database. I was thinking about splitting the form ...
1
vote
0answers
19 views

Execute raw SQL query in ASP.NET MVC, and pass for the view

I need convert this SQL in type Alumno this is a table on database in SQL Sserver and pass to the view for use the model form string query = "SELECT alum.IdAlumno, Nombres + ' ' + alum.Apellido1 + ' '...
0
votes
1answer
20 views

How to have .Net Core Action return Nothing or Redirect

Using .Net Core 2.2 I have several Controller actions that redirect to another action. More specifically there are several API calls, each one can fail or pass. If one passes, it will redirect to ...
0
votes
1answer
15 views

How to retrieve a VarBinary document to an ASP.NET MVC view

I have a SQL Server database that I am using ASP.NET MVC to upload documents and images (PDF's txt ect..). I have 2 questions: I have the datatype for the image column currently as varbinary(MAX), ...
0
votes
0answers
7 views

How to use Condition IF in DataGrid DevExtreme

columns.AddFor(ts => if (ts.value) { "Result"} else { "Result" } ).Caption("value"); //Similary this
0
votes
1answer
27 views

AJAX call to WebAPI Get method with Parameters not downloading file ASP .NET MVC

I am trying to download an excel file from WEB API Get method of type HttpResponseMessage. I am able to hit the method by making an AJAX call, the method also returns a resultcontent, but it's not ...
0
votes
0answers
15 views

.NET Entity Framework Scaffolding + MVC + MySQL DB

I created a Business layer with EF database first approach. I used a MySQL database. Context class and table classes were generated fine. So I created a default MVC project for my UI layer then I ...
0
votes
1answer
22 views

Referencing a project in MVC

I have an MVC that gets files submitted to it through the user interface which are then saved in a folder. I also have a separate project that I made a while back that takes a folder, converts the ...
-1
votes
0answers
14 views

$.hubConnection is not a function in Angular 7

I have a Angular 7 application with ASP MVC. Before I was using JavaScript to connect to signalR Hub and it is working good. I would like to try signalr on Angular 7. I did not change my backend ...
1
vote
1answer
28 views

Unexpected @Html.HiddenFor() behaviour in asp.net 4.5.2

I have some strange behaviour with a @Html.HiddenFor() helper and was wondering if this was by design? There's an id field that takes essentially a Guid string value for a booking form, naturaly ...
0
votes
0answers
12 views

Get list of file names in a directory without user interaction via AJAX

I have a MVC ASP.NET application that I am using as a web app primarily for use on an iPad. I have text-to-speech, and in order for the audio to play per iOS' recent autoplay rules, I need to have all ...
0
votes
0answers
30 views

How to make cascading drop-down list using just one class?

I've already saw examples of that perfectly working but with two separate classes but I'm trying to do a cascading drop-down list just using a single class using ASP.NET MVC. My class: namespace ...
-7
votes
0answers
32 views

Get every month name and months total Sum of purchase item and daily purchased item every day and display in ASP.NET MVC [closed]

How can I get every month name and months total Sum of purchase item and daily purchased item every day and display in ASP.NET MVC This is my current query: select Month(purchaseDate) as date, ...
0
votes
0answers
26 views

Read QR Code via USB Camera in ASP.NET MVC Application

I'm developing a webApplication for an internal equipment rental service, in the company i'm working at. When lending and returning items, the user should be able to scan the items QR code. The ...
0
votes
0answers
21 views

asp.net mvc hide download page opening

My case ı have big excel exports ım never stored thıs fıles my server ım create and download client so ı need to keep scope or my export operations is failing my button is this <input type="button"...
-2
votes
0answers
19 views

OneDrive rest API Authentication directly without user/password input screen

I want to access OneDrive documents in my application. I want to authenticate user directly with userid and password from configuration (don't want to redirect to windows live login page and then ...
0
votes
0answers
8 views

2 Binding domain name for angular 6 on IIS does not works for one binding name

I have a angular 6 App which is deployed on IIS with 2 binding name i.e. www.example.com and example.com but the site only work for www.example.com but for example.com it throws ...
0
votes
1answer
15 views

ASP.NET MVC: Dowloading data as a file to local computer. SAve As dialog

I generate a xml dynamically (serializing my custom type XMLDocType) in an ASP.NET MVC3 through the code below: XMLDocType XMLdoc = new XMLDocType(); … generating contente for XMLdoc … XmlSerializer ...
0
votes
1answer
21 views

Is there any function in .net core 3.0 that can match url with its route

I have a string containing a URL and I want to get the route that matches this URL. Let's say the URL string contains the value http://localhost/PerformOperation/accountId/Operation/operationId ...
0
votes
1answer
37 views

complex custom model binding in aspnet core with inheritance in property's class

I am trying to do custom model binding in Core(2.2/3.1) with an inherited sub class. I use IModelBinderProvider and IModelBinder to manipulate my model binding as MVC doesn't know whether to ...
0
votes
0answers
7 views

[A]Sales.ExtendedUserEntityMaster cannot be cast to [B]Sales.ExtendedUserEntityMaster

I got this error after replacing the dll (Sales) from bin folder in production. Once I restarted the IIS the issue gets resolved. However, while replacing the dll, I had reset the IIS. Not sure why ...
0
votes
0answers
10 views

Issue while validating JWT Bearer token with asp.netmvc framework 4.5

I am using asp.net mvc webapi in 4.5 framework named as webapitestproject ,and using jwt bearer token validation to validate the api. I am having one identityserver 4 project from where i am getting ...
-1
votes
3answers
51 views

Expensive time displaying +100.000 entries in a CSHTML Table

I've been working on my application that displays a table with entries of Cars actually on the market. As this application has to handdle with a lot of information (More than 100.000 entries), I'm ...
0
votes
0answers
31 views

why am i getting error CS0246 in .net core 3?

I created a project in dot-net core 3.0.100. but i got mysterious error while try to run the project, this occurred after i installed few packages which listed bellow. - > Microsoft.AspNet.WebApi....
-1
votes
4answers
59 views

How to convert my site to multi language supported site

I developed site using ASP.net & c# it support English language, but now i want to convert my site to Multi language supported site. Any one please explain, how to do it? and what are the ...
5
votes
2answers
68 views

Which constructor will be called when registering services in ConfigureServices

If I have two constructors for a class, how does the service container choose which one to use when I'm registering that service in ConfigureServices? So lets say I have a class called MyClass with a ...
-1
votes
2answers
22 views

mvc 5 deploy to win10 IIS failure

I would like to publish an MVC5 web application to windows 10 IIS machine. I have successfully deployed MVC Core on that machine, but I'm unsuccessful deploying an MVC 5 application. I created a new ...
-1
votes
1answer
18 views

Hold input data seached from database temporarily and show to view mvc and save it

I have to fetch data from sql based on the user input criteria and display it to user. At a time user can do multiple searches and all the result should display in the table below the search textbox. ...
0
votes
1answer
31 views

Seeding Database in Asp.net Core, cannot create admin account

I'm trying to create a default admin account when I start an application. Now what I'm interested in is how to seed a database in asp.net core. I have a seed code that I run in the main program. It ...
0
votes
1answer
60 views

c# How to show a popup with an <a> to confirm they want to perform the asp-action

So i have this a tag and this deletes an event now i want it to show a popup to make sure that they actually want to delete it. this is my tag <a asp-area="User" asp-controller="...
0
votes
0answers
16 views

Default data appears in collection while binding it to controller parameter

My controller receives collection. I make a simple ajax request but collection value set as null. And I noticed that in my controller the collection is instantiated, has Count = 1 and has default ...
0
votes
1answer
49 views

Cannot Read Property Undefined

I have created an endpoint in my .NET Core MVC project. My Api is: [HttpGet("/api/notifications")] public async Task<IActionResult> Notifications() { var user = await GetCurrentUserAsync(...
0
votes
0answers
12 views

MVC engine create some 301 redirect on my controller action

after updating an old MVC application to MVC 5.2.7 I start to have some 301 redirect on my ajax call. Somthing is for the last / added in the 301 location field, somthime is the name of one parameter ...
0
votes
1answer
40 views

DropdownFor and assigning Class on each <option>

Is there any way to get a dropdownfor to handle adding a class to each option where the class is the text of the option? So by way of example: <option class = "Example-1" value = "101" >...
0
votes
1answer
22 views

Update label value on live is not working

I`m working on a web application for Blockchain wallet, there I have a method that reads the live current balance of the wallet (from the blockchain). After the reading, I update some labeles that ...
0
votes
0answers
50 views

The call is ambiguous between the following methods or properties?

Currently, I am working on an old project and I met too many errors, my goal is to succeed the deployment on my local machine, Brief in this below class, the GetHelpPageSampleGenerator() is underlined ...
0
votes
3answers
30 views

How to send a file from ajax to aspnet mvc class

I'm trying to pass a file to my aspnet project without using FormData, all the values are sent but the file itself. So I was able to if ($('#Prop').get(0).files.length === 0 check if theres something ...
0
votes
1answer
12 views

Need collapsible pane for all uls in the following navigation code. ASP.NET MVC

I am working on making a dynamic populated menu a collapsible menu. I have a large list to display which populates with some descriptive section headings in the middle. I have tried using the ...
0
votes
0answers
21 views

Angular with Web API ERROR HttpErrorResponse {headers: HttpHeaders, status: 500, statusText: “Internal Server Error”

I am trying to use Angular-8 with WebAPI-2 but getting error with 500 status code. Tried the same service code with ASP.Net MVC and is working fine. Web API Code: TestController.cs public ...
0
votes
0answers
14 views

Formatting date column in Kendo ASP.NET MVC Grid

How do I format this date like: Today, Yesterday or <date> in Telerik Kendo ASP.NET MVC grid? columns.Bound(c => c.DesktopActivation) .ClientTemplate("#= DesktopActivation ? ...
-1
votes
0answers
20 views

Thumbnail of a Flash (.swf) file using asp.net mpv

Greeting, I have a bunch of files(locally) and need to get, programmatically, a thumbnail of it. I have no problems with all of them accept flash(.swf) files. I need to extract a frame from it or ...
-1
votes
1answer
37 views

Add own data annotation to an Enum

I am working in an ASP.NET MVC 5.2 application. I have the following enum: CODE public enum NatureOfEnquiry { [Display(Name = "A request for change")] RequestForChange = 1, [Display(...
0
votes
3answers
54 views

The Controller for path /api/* was not found or does not implement IController

I am currently learning ASP.NET MVC and I have been given a task to create a website where the user can upload a file to. I have written the following FileUploadingController as an API which when I ...
0
votes
1answer
29 views

Can access paths externally using react router on top of a asp.net project

I have a asp.net project that runs on IIS, and I've got a page that renders the React SPA. When navigating from inside the app, then the react router seems to do the work and I'm routed to the right ...
0
votes
0answers
15 views

Jenkins build not working - package installed but not detected in Reference for ASP.NET MVC Project

I am creating CICD setup for ASP.Net MVC project in Jenkins. Jenkins build fails due missing package in project. but when I logged in Build server machine (Jenkins) and checked package in packages ...
0
votes
0answers
18 views

mvc core add reportviewer

In my last few month, I create MVC5 in Vs2017 success to create reportviewer by add ReportViewerForMvc However, when I use VS2019, create asp.net framework under.netcore 2.2 I success to add ...
0
votes
1answer
55 views

rework linq query to returns nested objects

Im having a db table like this And my query linq looks like var selectedNotifications = _dbContext.UserNotificationTypeDeliveryChoice .Include(m => m.NotificationGroup) .Include(m =>...
1
vote
0answers
29 views

Check if date is within the range

I am implementing appointment booking functionality using jqxSchedule. I am creating one API using .net MVC where i need to check whether or not given date is within the range of dates with ...