Questions tagged [asp.net-mvc-3]
ASP.NET MVC 3 is the third major version of Model-View-Controller extension for developing web applications in a .NET framework
65 questions
2
votes
1
answer
4k
views
Right usage of ViewModels in MVC
I'm new to MVC and i'm having some difficulty on understanding the proper usage of ViewModels and Controllers.
I have this ...
3
votes
2
answers
3k
views
User Login Logic
I want to see if this is as streamlined as possible. Most of the logic is accomplished through methods in the model. The controller does one of four things:
redirects new users to registration
...
2
votes
2
answers
752
views
Return custom assembly attribute variables
I have a custom attribute in my assembly called SemverAttribute, and I have a helper class called AppInfo that has a function to return a number called the Semver number. It accepts an id of null-6. ...
4
votes
1
answer
1k
views
Using static management class to control db transactions through an EF6
I have the class below to manage my specific implementation of a membership system using entity framework 6.1
Is the use of static access correct in this case? as far as I understood that EF context ...
17
votes
1
answer
24k
views
Using separate DBContext classes
I know that the DBContext represents a session (Unit-Of-Work and Repository) with the database, however I an unsure as to when I should have a different ...
1
vote
1
answer
11k
views
Using AutoMapper in ASP.Net MVC
I'd like to check my understanding and usage of the AutoMapper in my ASP.Net MVC app.
I setup the maps in Application_Start:
...
4
votes
3
answers
2k
views
View model with properties that represent years and months
I have a view model with properties that represent years and months:
...
7
votes
2
answers
983
views
MembershipProvider with Entity Framework and IoC
I am using Castle Windsor as my IoC container and I registered it as a DependencyResolver to let the MVC framework know about it.
With the Entity Framework I have ...
4
votes
2
answers
1k
views
Drop-down for populating a list of cities
I have created a drop-down to populate a list of cities. Everything works fine, but I would like to know better ways of doing this. Also, please let me know if it is possible to create the same drop ...
20
votes
1
answer
42k
views
Correct usage of EF's DBContext in ASP.NET MVC application with Castle Windsor
I am trying to use Entity Framework as simple as posible. Use UnitOfWork and Repository patterns seems to be overkill because whole web application will be pretty straightforward. I came with this ...
5
votes
2
answers
11k
views
Is it ok to use HttpContext inside View?
I have a pretty common issue: I need to know the name of current user and also name of the current controller so I can highlight/disable some links.
Here's some solutions I found by myself:
Get all ...
6
votes
2
answers
1k
views
Is this user input field secure?
I'm pretty new to asp and c# and I have a couple of concerns with the security of the code I have written (shown below). Basically all it does is allow you to enter a quantity before you add the item ...
5
votes
1
answer
8k
views
Wrapper for jquery ajax to ensure redirects occur on clientside
Recently I had the need to make some ajax calls within a MVC 3.0 with Razor and jQuery application. After a bit of trial and error and refactoring it was discovered that a number of different needs ...
4
votes
2
answers
17k
views
Search and filter in MVC3 Razor using Linq
This code works fine, but I just don't like all the if else. If I keep adding field to filter, it's going to get messy.
I am not using EF and cannot on this.
...
3
votes
3
answers
236
views
What standard should I use for the naming of my MVC controller services?
I have the following:
...