200,782 questions
405
votes
22
answers
132k
views
OwinStartup not firing
I had the OwinStartup configuration code working perfectly and then it stopped working. Unfortunately I'm not sure exactly what I did to get it to stop working and am having a really hard time ...
0
votes
0
answers
64
views
Error executing child request for handler: not finding the controller
I'm learning ASP.NET MVC with creating a minimal website which just shows some products.
I want to access my start project which it has layout and for that, I should run the project from /Home/Index.
...
434
votes
21
answers
30k
views
Reflecting parameter name: abuse of C# lambda expressions or syntax brilliance? [closed]
I am looking at the MvcContrib Grid component and I'm fascinated, yet at the same time repulsed, by a syntactic trick used in the Grid syntax:
.Attributes(style => "width:100%")
The syntax above ...
1
vote
1
answer
56
views
href being interrupted by database login
I'm using ASP.NET MVC. This code sits in the Index.cshtml view (I will also place it in the details view). I have a href link which does what it's supposed to do if the user is logged into the ...
278
votes
20
answers
478k
views
HTTP Error 500.19 and error code : 0x80070021
I have a simple webAPI build by Visual Studio 2013. It works well when I run it from VS13 but when I copy the project in local IIS it gives me the following error.
HTTP Error 500.19 - Internal Server ...
1
vote
1
answer
276
views
How can I configure libgit2sharp ssh authentication within an IIS, ASP.NET MVC, C# application?
I am using libgit2sharp within an ASP.NET MVC application writtein in C# and running on IIS v.10.0 (Windows Server 2019). It is working well to execute git commands against the local server's git ...
545
votes
19
answers
326k
views
How to fix: Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list
I am configuring an MVC 3 project to work on a local install of IIS and came across the following 500 error:
Handler "PageHandlerFactory-Integrated" has a bad module
"ManagedPipelineHandler" in ...
0
votes
0
answers
75
views
ASP.NET MVC model binding FormData with arrays (with bracketed indexes)
Using model binding, ASP.NET MVC can take FormData from a form with repeating elements, signified by the use of indexes in square brackets, and populate a .NET object.
So this:
MyItem[0].MyId=1321&...
132
votes
18
answers
141k
views
Your connection is not private NET::ERR_CERT_COMMON_NAME_INVALID
While debugging a local ASP.NET application on Chrome for localhost Https site it's giving error:
Your connection is not private NET::ERR_CERT_COMMON_NAME_INVALID.
I am not able to open localhost ...
0
votes
0
answers
53
views
How to fix the 'Generic Padding Oracle' vulnerability when recommended steps fail
I have been scanning our deployed (ASP.NET Framework 4.7.2) applications for vulnerabilities and on one of them have encountered the OWASP warning Generic Padding Oracle. My understanding of this ...
484
votes
20
answers
280k
views
Can an ASP.NET MVC controller return an Image?
Can I create a Controller that simply returns an image asset?
I would like to route this logic through a controller, whenever a URL such as the following is requested:
www.mywebsite.com/resource/...
251
votes
43
answers
223k
views
Error: «Could not load type MvcApplication»
I am getting the error
Could not load type MvcApplication
when I try to run my website.
How to correct it?
119
votes
16
answers
217k
views
Build:Cannot find type definition file for 'node'
VS 2015 community edition (at home), npm 3.10, Angular 2
Im trying to pull get Angular2 setup within an ASP.Net MVC 5 app. The template I started with used an older version of Angular, so I updated ...
391
votes
23
answers
256k
views
Injecting content into specific sections from a partial view ASP.NET MVC 3 with Razor View Engine
I have this section defined in my _Layout.cshtml
@RenderSection("Scripts", false)
I can easily use it from a view:
@section Scripts {
@*Stuff comes here*@
}
What I'm struggling with is how to ...
218
votes
15
answers
223k
views
How to add/update child entities when updating a parent entity in EF
The two entities are one-to-many relationship (built by code first fluent api).
public class Parent
{
public Parent()
{
this.Children = new List<Child>();
}
public int ...
344
votes
27
answers
399k
views
How can I get my webapp's base URL in ASP.NET MVC?
How can I quickly determine what the root URL is for my ASP.NET MVC application? I.e., if IIS is set to serve my application at http://example.com/foo/bar, then I'd like to be able to get that URL in ...
410
votes
9
answers
325k
views
Difference between ApiController and Controller in ASP.NET MVC
I've been playing around with ASP.NET MVC 4 beta and I see two types of controllers now: ApiController and Controller.
I'm little confused at what situations I can choose a particular controller.
...
677
votes
9
answers
230k
views
ASP.NET MVC - Set custom IIdentity or IPrincipal
I need to do something fairly simple: in my ASP.NET MVC application, I want to set a custom IIdentity / IPrincipal. Whichever is easier / more suitable. I want to extend the default so that I can call ...
148
votes
12
answers
142k
views
ASP.NET Core : Synchronous operations are disallowed. Call WriteAsync or set AllowSynchronousIO to true instead
ASP.NET core server, AllowSynchronousIO is set to false
new WebHostBuilder()
.UseKestrel(options =>
{
options.AllowSynchronousIO = false;
})
In the ...
1
vote
1
answer
81
views
WCF Service reference must be recreated every time I reopen ASP.NET MVC project — how to fix that?
I have an ASP.NET MVC application that communicates with a WCF service hosted locally. Currently, I consume the WCF service using a Service Reference added via Visual Studio.
The problem is: every ...
0
votes
1
answer
155
views
DevExtreme selectbox refresh (reload) datasource
I'm using a DevExtreme SelectBox in an ASP.NET MVC project. I want the data source to reload every time the dropdown is opened, so that dynamic LoadParams values (like EmployeeId and DocumentDate) are ...
0
votes
1
answer
53
views
How to turn off JSON error responses in ASP.NET Framework 4.5
We have an old app and no matter what we do, we can't seem to get it to stop emitting JSON error responses. We want just a generic message that won't expose important security details.
We've compiled ...
172
votes
31
answers
687k
views
ArgumentException: An item with the same key has already been added
I get this error whenever I submit the form also the action method is not being called because of this:
ArgumentException: An item with the same key has already been added.
And the exception details:...
1
vote
0
answers
45
views
DevExpress MVC Grid Callbacks Not Reaching Controller After Migrating to Azure AD B2C (OWIN)
I have an ASP.NET MVC web application using DevExpress controls (specifically ASPxGridView and MVCxGridView) that was originally using Forms authentication.
As part of a security enhancement, I’ve ...
339
votes
17
answers
325k
views
Validation failed for one or more entities while saving changes to SQL Server Database using Entity Framework
I want to save my Edit to Database and I am using Entity FrameWork Code-First in ASP.NET MVC 3 / C# but I am getting errors. In my Event class, I have DateTime and TimeSpan datatypes but in my ...