tagged [asp.net-mvc-5]
ASP.NET MVC Routing based on domain & hostname
ASP.NET MVC Routing based on domain & hostname I am new to ASP.NET MVC, most of my experience is on ASP.NET Webforms. Is there a way to setup routing based on domain/hostname, i.e. www.domain.com goes...
- Modified
- 19 Nov at 07:5
Set default global json serializer settings
Set default global json serializer settings I'm trying to set the global serializer settings like this in my `global.asax`. ``` var formatter = GlobalConfiguration.Configuration.Formatters.JsonFormatt...
- Modified
- 16 Feb at 18:45
Getting controller name from razor
Getting controller name from razor I seem to be having a difficult getting something that should be easy. From within my view, using Razor, I'd like to get the name of the current controller. For exam...
- Modified
- 17 Oct at 00:3
How to check if session value is null or session key does not exist in asp.net mvc - 5
How to check if session value is null or session key does not exist in asp.net mvc - 5 I have one ASP.Net MVC - 5 application and I want to check if the session value is null before accessing it. But ...
- Modified
- 25 Jan at 15:32
Verify newly entered password of logged in user
Verify newly entered password of logged in user User is logged in and wants to do something major and I want them to re-enter their password so I can make sure that they are the user that is logged in...
- Modified
- 11 Jun at 17:26
When unit testing, how do I mock a return null from async method?
When unit testing, how do I mock a return null from async method? Normally, I mock my repo like so: But, in my code, I check to see if the member is not found, i.e. GetMemberAsync ret
- Modified
- 26 Oct at 22:39
How to bind IAuthenticationManager with Ninject in ASP.NET MVC 5?
How to bind IAuthenticationManager with Ninject in ASP.NET MVC 5? I'm trying to bind `IAuthenticationManager` with Ninject so it can be injected into my `AuthenticationService`. The problem is that I ...
- Modified
- 23 Mar at 02:56
How to add claims during user registration
How to add claims during user registration I'm using ASP.NET MVC 5 project with identity 2.1.0 and VS2013 U4. I want to add claims to user during registration in order to be stored in db. These claims...
- Modified
- 27 Jan at 09:23
There was an error running the selected code generator: 'Object reference not set to an instance of an object.' Error?
There was an error running the selected code generator: 'Object reference not set to an instance of an object.' Error? [](https://i.stack.imgur.com/SNj5M.png) I have tried all the solution like repair...
- Modified
- 24 Aug at 16:29
How require authorization within whole ASP .NET MVC application
How require authorization within whole ASP .NET MVC application I create application where every action beside those which enable login should be out of limits for not logged user. Should I add `[Auth...
- Modified
- 26 Jul at 12:24
Downloading of zip file through ASP.NET MVC using DotNetZip
Downloading of zip file through ASP.NET MVC using DotNetZip I have created a text file in a folder and zipped that folder and saved @same location for test purpose. I wanted to download that zip file ...
- Modified
- 5 Jan at 23:1
How do I properly register AutoFac in a basic MVC5.1 website?
How do I properly register AutoFac in a basic MVC5.1 website? AutoFac has recently been updated for MVC 5.1 but at the time of writing I find that the documentation is lacking (especially for a simple...
- Modified
- 2 Mar at 17:57
Does autofac supports the new Web Api 2
Does autofac supports the new Web Api 2 I'm developing a web api as part of a MVC/API ASP.NET on VS 2013, MVC 5, API 2, but my `AutofacWebApiDependencyResolver` throws an exception every time I try to...
- Modified
- 26 Dec at 20:55
GenerateEmailConfirmationTokenAsync default expiration timespan
GenerateEmailConfirmationTokenAsync default expiration timespan What is default expiration timespan of GenerateEmailConfirmationTokenAsync? and what kind of errors should I get from ConfirmEmailAsync?...
- Modified
- 7 Mar at 11:44
About Enum and DataAnnotation
About Enum and DataAnnotation I have this Enum (Notebook.cs): Also this property in my class (TIDepartment.cs): It's working perfectly, I just have one "problem": I created an EnumDDLFor and it's show
- Modified
- 26 May at 20:8
Models.ApplicationDbContext for all models in an Asp.Net MVC 5 application?
Models.ApplicationDbContext for all models in an Asp.Net MVC 5 application? I've creating an Asp.Net MVC 5 website. I think I should just use one context type. However, the code scaffold already gener...
- Modified
- 6 Jun at 15:16
Asp.Net MVC 5 without Owin?
Asp.Net MVC 5 without Owin? Mvc 5 seems to depend on Owin, which is great if you want to self host or run on a Mac. But lets assume I just want to run under IIS just like the previous versions and I'm...
- Modified
- 19 Apr at 21:27
How to create dependency injection for ASP.NET MVC 5?
How to create dependency injection for ASP.NET MVC 5? Creating Dependency Injection with ASP.NET Core is fairly easy. The documentation explains it very well [here](https://learn.microsoft.com/en-us/a...
- Modified
- 9 Apr at 19:43
Can you extend HttpContext.Current.User.Identity properties
Can you extend HttpContext.Current.User.Identity properties Is there a way to override `HttpContext.Current.User.Identity` to add another property (screen name)? My application uses `Identity` and I'v...
- Modified
- 12 Aug at 20:19
How to add Web API to an existing ASP.NET MVC (5) Web Application project?
How to add Web API to an existing ASP.NET MVC (5) Web Application project? Assuming you forgot to tick the Web API checkbox (add it to the project) when making a new MVC (5) project, what do you need ...
- Modified
- 23 May at 12:2
How to get current user, and how to use User class in MVC5?
How to get current user, and how to use User class in MVC5? - - `User``Items``Id``Item``User``List` I'm using "Individual User Accounts" from the MVC template. Tried these: - [How do I get the current...
- Modified
- 23 May at 12:26
How to configure StructureMap for asp.net MVC 5
How to configure StructureMap for asp.net MVC 5 I'm getting below error. I setup it similar to asp.net mvc 4. > No parameterless constructor defined for this object. Description: An unhandled excepti...
- Modified
- 22 Oct at 08:16
Can I run MVC 5 application on .NET Framework 4.0?
Can I run MVC 5 application on .NET Framework 4.0? I have my MVC 5 application that I create in VS 2013. Now I'm trying to deploy this application and I have a question: Can I deploy MVC 5 on the serv...
- Modified
- 4 Dec at 21:7
How can I use Url.Action with list parameters?
How can I use Url.Action with list parameters? Say I have an action method: The way the MVC model binding works, it expects a list of category like this: So my questions are: ### How do I create that ...
- Modified
- 14 Feb at 17:10
How to set Swagger as default start page?
How to set Swagger as default start page? How do I set Swagger as the default start page instead of `/Account/Login`? I'm using ASP.NET MVC 5.x + Angular 1.x. # Update Current code: ``` public static ...
- Modified
- 25 Nov at 23:32