Skip to main content

Questions tagged [asp.net-mvc]

Model-View-Controller for the ASP.NET framework

Filter by
Sorted by
Tagged with
2 votes
1 answer
119 views

I use this code as reference for when I start working on a new project whether that be for personal or for work. It's worked fine so far, but I'm wondering if anyone can read it and provide any ...
sammy medawar's user avatar
0 votes
0 answers
116 views

I wrote this to have ASP.NET MVC be able to respond as a web API as well as the normal MVC Razor pages. I wanted Newtonsoft deserialization for models based on already parsed values: ...
MPelletier's user avatar
2 votes
1 answer
249 views

I am working project where I need to build ASP.net control based on JSON data. I am using the method below GetMeetingPollingQuestion to create this model. Any suggestions/comments are greatly ...
Jefferson's user avatar
  • 423
2 votes
1 answer
300 views

I am working project where I need to build ASP.net control base on JSON data. I am using this method below to get all the data into class. I as using FirstOrDefault ...
Jefferson's user avatar
  • 423
1 vote
1 answer
139 views

I have created a code that displays a table with exchange rate data. Have I used loops and conditions (if else) in a good way? ...
mariuszKen's user avatar
3 votes
2 answers
1k views

On the basis of the daily exchange rate data of the CB (https://ww.cbr-xml-daily.ru/daily_json.js) it is necessary to create a Web-service using ASP.Net Core, which implements 2 API methods: ...
Aarnihauta's user avatar
1 vote
1 answer
103 views

Let's suppose I have 2 repositories: first is responsible for creating job and return jobId second is responsible for creating ...
mikolaj semeniuk's user avatar
1 vote
1 answer
89 views

This logic checks different method and adds links to response that is returned to a view. I there a better way to do this ? ...
Jefferson's user avatar
  • 423
0 votes
2 answers
422 views

I tried to make a calculator using the Strategy pattern in ASP.Net Core MVC (following an example from the Internet) Please review my code and tell me what could be wrong and how to make it better? My ...
WarmingZ's user avatar
1 vote
1 answer
2k views

I want to check client's browser version, and if it's too old, display a message that the user should update their browser in order to use the website. The website is built using ASP.NET MVC. I have ...
Hooman Bahreini's user avatar
0 votes
0 answers
73 views

I'm implementing a system, which requires an order to be active. I have a class called Yritys, which is the customer account who would have credits. 1 credit would mean 1 day of service use. Yritys (...
jluck's user avatar
  • 9
0 votes
1 answer
133 views

I wrote a fileupload function for my application. Basically the application is a web based folder structure, which has files included. I don't know, but I am not happy with it. Is it too long? Can I ...
Spedo De La Rossa's user avatar
0 votes
1 answer
7k views

I am trying to using HttpClient for making API calls from a different domain and for that purpose I have created the following service class after doing some research. It is 4.7.2 framework and not a ....
chiru1983's user avatar
5 votes
2 answers
3k views

So I am using the latest version of Dapper and it works great for mapping my POCO classes but there are some scenarios where I need to return a DataSet instead of ...
Rahul Sharma's user avatar
2 votes
0 answers
79 views

I have asked this question on stackoverflow... here, I am asking for some feedback on the solution that I have implemented. I am using ASP.NET MVC default template to logout user: ...
Hooman Bahreini's user avatar
3 votes
2 answers
3k views

I have this code that I am using to update OriginalId using the Id value. I there a better way to do this then using all the loops? Controller ...
Jefferson's user avatar
  • 423
1 vote
1 answer
116 views

I've been asigned to a project no dev has touched in a long time. It's an ASP.NET MVC 4 application. It appeared to be well coded, but had no testing and the database migration folder is not present. ...
Peter's user avatar
  • 165
9 votes
3 answers
961 views

Background I am working on an e-commerce website, my web server is written in ASP.NET MVC (C#, EF6) and I am using 3 instances of MySQL DB. These DBs are in a cluster (Galera Cluster) and they are ...
Hooman Bahreini's user avatar
0 votes
1 answer
117 views

I am fairly new into asp.net MVC c# I am working on request holiday app where an employee can request holidays. The problem is the app works fine, however, I am trying to set 8 hours a day when an ...
beetle_juice's user avatar
3 votes
1 answer
226 views

I am working on an e-commerce website. What I need to do is to save an advertisement. The ad has some properties and some photos... properties should be save to DB and photos should be saved to file ...
Hooman Bahreini's user avatar
1 vote
1 answer
1k views

I'm trying to filter items from an ecommerce site.The project on the local server was running smoothly.However, I noticed significant delays since the project was published on the global server.Most ...
Elxan's user avatar
  • 53
1 vote
1 answer
117 views

I want to be able to list every Transaction associated with a Client in date order. ...
Carmax's user avatar
  • 229
1 vote
1 answer
218 views

I'm creating a filter with Linq in an ASP.NET MVC application. I was hoping I could get some tips on performance enhancements, aside from any possible performance enhancements. I have a few questions:...
Train's user avatar
  • 311
9 votes
4 answers
4k views

Problem Description I am working on an e-commerce website, when a user wants to sell a product, he would open the product page and he can upload up to 12 photos: Image Upload Process This is the ...
Hooman Bahreini's user avatar
1 vote
1 answer
2k views

I have a custom model binder which takes user input in HTML format, sanitize the HTML input by removing any script or XSS threat and returns the sanitized HTML string: ...
Hooman Bahreini's user avatar
3 votes
1 answer
2k views

We have an existing situation in an MVC ASP.NET app where it's possible for two threads to come back asynchronously, one from an external api(the payment gateway) and one from within the browser for ...
PabloInNZ's user avatar
  • 133
4 votes
1 answer
999 views

We use the architecture shown in the code below to initialize the DB context for our MVC 5 project using entity framework 6 We have the following questions related to it: Is it safe to initialize the ...
prinkpan's user avatar
  • 201
1 vote
1 answer
193 views

1. Backstory I recently starting programming and I found out that Entity Framework works perfect for my small-sized applications due its simplicity. I've made my custom authorize attribute for MVC ...
Roberto99's user avatar
3 votes
0 answers
2k views

I have a controller in an ASP.NET Web API application which generates a CSV file. The controller looks like this: ...
StepUp's user avatar
  • 563
3 votes
0 answers
2k views

I'm a junior developer (couple years into it) and very new to AJAX. I'm writing an internal inventory application built on MVC and right now I'm dealing with adding and removing items to/from a cart. ...
Davide Vitali's user avatar
1 vote
1 answer
119 views

I want to display on a view the EmployeeHistory view model sorted by elements.assignEffDateNext and I want to instantiate and ...
ckb888's user avatar
  • 41
2 votes
1 answer
2k views

I am using .NET Core 2.2, EF Core and C#. I have created a web API project. I was requested to do an Upsert (insert or update). The entities structure is: Movie User Rating: this is used to give a ...
MarcosF8's user avatar
  • 121
0 votes
2 answers
126 views

I just wrote this, but I am not realy happy with that. I think there is an easier way to do this. First I am checking if a user has an ID (from a portal we are using, it is in the header). After that ...
Spedo De La Rossa's user avatar
3 votes
1 answer
210 views

I am building an e-commerce website. I have an application layer service called SearchService. SearchService receives a search ...
Hooman Bahreini's user avatar
0 votes
1 answer
216 views

I need advise whether the approach I took is the optimal one (not sure whether this is the right 'stackExchange' site). I have an MVC application, which is supposed to be able to render an HTML page ...
Bartosz's user avatar
  • 221
1 vote
1 answer
167 views

I've created a simple API wrapper that I intend a few developers to utilize. I decided to follow an Fluent Interface methodology, similar to this. ...
jon.r's user avatar
  • 429
2 votes
1 answer
659 views

I'm learning ASP.NET Core with MVC pattern and I didn't find anything useful related to this argument. Actually I'm looking ...
Charanoglu's user avatar
4 votes
1 answer
2k views

In my ASP.NET MVC application there are occasions where I need to generate an absolute URI, such as when sending an email confirmation link to a user. The most straightforward approach is to use ...
Phil's user avatar
  • 173
2 votes
1 answer
406 views

It's a question which lies me for years on the tongue. Given a LoginViewModel: ...
Christian Gollhardt's user avatar
0 votes
2 answers
12k views

Program is written in .Net Framework 4. Class: ...
Pop's user avatar
  • 387
3 votes
1 answer
2k views

I want to create a AuthorizeAttribute that gets the current ActionMethod RouteData and ...
AminM's user avatar
  • 93
10 votes
1 answer
613 views

A year or so ago, I wrote a checkers game for the Universal Windows Platform. Now, I wrote a web-based version of it hosted at http://checkerstreasury.azurewebsites.net. This is the first of a series ...
user avatar
2 votes
1 answer
4k views

Here I am trying to post a company view-model and update and insert according. But I feel I am writing it in wrong way or maybe there's a better approach. Here's my code ...
Siraj M's user avatar
  • 115
1 vote
3 answers
6k views

I have an asp.net core app that sends emails with a link. When they click the link they can start taking an online test without logging in. The link contains a number that is validated by the ...
Johan Herstad's user avatar
2 votes
1 answer
1k views

I have never created a web service before. I followed most of this Pluralsight tutorial to give me an idea of how to create one using ASP.NET MVC along with .NET Core 2.0 and Entity Framework Core. ...
Window's user avatar
  • 123
1 vote
1 answer
1k views

The below code works but there's a lot of duplication I wonder if I can get around. I would like to be able to use .AddDeveloperSigningCredential(false) if in ...
egmfrs's user avatar
  • 185
3 votes
1 answer
4k views

Background One of the projects I'm working on is an Intranet website which is a front-end for several kinds of data, each aimed at a different set of users. Access to the website is handled through ...
BCdotWEB's user avatar
  • 11.4k
5 votes
1 answer
5k views

I started a week ago to split my project into layers: business logic layer, data access layer and UI layer. I took as an example this project: https://github.com/dotnet-architecture/eShopOnWeb. I ...
ursachan's user avatar
4 votes
3 answers
647 views

I would like to store an integer value in the application cache. The GetOrSet method should always return an int, and never be null. If there is no cached value, ...
Carmax's user avatar
  • 229
5 votes
1 answer
4k views

In my case, I needed to give roles to users, but to specific departments, and I did not want to implement a new authorization mechanism which will require me to access the db everytime I want to check ...
Him's user avatar
  • 153

1
2 3 4 5