Tag: asp.net

49 votes
9 answers
587 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 / IPrinc

avatar
Frederick
0 1 0 9
asked 07 September, 2021
58 votes
30 answers
2.1K views
Can I set an unlimited length for maxJsonLength in web.config?

I am using the autocomplete feature of jQuery. When I try to retrieve the list of more then 17000 records (eac

avatar
Lorenzo
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
556 views
How do you create a dropdownlist from an enum in ASP.NET MVC?

I'm trying to use the Html.DropDownList extension method but can't figure out how to use it with an

avatar
Kristopher
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
445 views
How do you handle multiple submit buttons in ASP.NET MVC Framework?

Is there some easy way to handle multiple submit buttons from the same form? For example: <% Html.BeginFor

avatar
Freida
0 1 0 9
asked 07 September, 2021
63 votes
23 answers
913 views
File Upload ASP.NET MVC 3.0

(Preface: this question is about ASP.NET MVC 3.0 which was released in 2011, it is not about ASP.NET Core 3.0

avatar
Serina
0 1 0 9
asked 07 September, 2021
63 votes
13 answers
1.9K views
Html.Partial vs Html.RenderPartial & Html.Action vs Html.RenderAction

In ASP.NET MVC, what is the difference between: Html.Partial and Html.RenderPartial Html.Action and Html.Rend

avatar
Lawanda
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
3.1K views
Could not find a part of the path ... bin oslyncsc.exe

I am trying to run Asp.net MVC project retrieved from TFS source control. I have added all assembly reference

avatar
Joseph
0 1 0 9
asked 07 September, 2021
50 votes
30 answers
1.8K views
A potentially dangerous Request.Form value was detected from the client

Every time a user posts something containing < or > in a page in my web application, I get this exceptio

avatar
Patsy
0 1 0 9
asked 07 September, 2021
46 votes
14 answers
854 views
How to set ASPNETCORE_ENVIRONMENT to be considered for publishing an ASP.NET Core application

When I publish my ASP.NET Core web application to my local file system, it always takes the production-config

avatar
Rufus
0 1 0 9
asked 07 September, 2021
49 votes
7 answers
1.6K views
Access the current HttpContext in ASP.NET Core

I need to access current HttpContext in a static method or a utility service. With classic ASP.NET MVC and Sy

avatar
Nidia
0 1 0 9
asked 07 September, 2021
64 votes
5 answers
1.8K views
How to return a specific status code and no contents from Controller?

I want the example controller below to return a status code 418 with no contents. Setting the status code is e

avatar
Wei
0 1 0 9
asked 07 September, 2021
57 votes
12 answers
808 views
How do I write logs from within Startup.cs?

In order to debug a .NET Core app which is failing on startup, I would like to write logs from within the star

avatar
Lynette
0 1 0 9
asked 07 September, 2021
59 votes
5 answers
928 views
Send HTTP POST message in ASP.NET Core using HttpClient PostAsJsonAsync

I want to send dynamic object like new { x = 1, y = 2 }; as body of HTTP POST message. So I try to write v

avatar
Patsy
0 1 0 9
asked 07 September, 2021
62 votes
10 answers
1.9K views
How do I access Configuration in any class in ASP.NET Core?

I have gone through configuration documentation on ASP.NET core. Documentation says you can access configurati

avatar
Eddie
0 1 0 9
asked 07 September, 2021
60 votes
3 answers
1.7K views
Return file in ASP.Net Core Web API

Problem I want to return a file in my ASP.Net Web API Controller, but all my approaches return the HttpRespon

avatar
Corrin
0 1 0 9
asked 07 September, 2021
56 votes
13 answers
2.7K views
.NET Core MVC Page Not Refreshing After Changes

I'm building a .NET Core MVC on the latest version 2.2. I have a problem when I make changes to the CSHTM

avatar
Virgil
0 1 0 9
asked 07 September, 2021
50 votes
4 answers
804 views
Token Based Authentication in ASP.NET Core

I'm working with ASP.NET Core application. I'm trying to implement Token Based Authentication but ca

avatar
Dorian
0 1 0 9
asked 07 September, 2021
53 votes
6 answers
2.1K views
Where did IMvcBuilder AddJsonOptions go in .Net Core 3.0?

I've just upgraded my ASP web API project from .Net core 2.0 to 3.0. I was using services.AddMvc(

avatar
Kurtis
0 1 0 9
asked 07 September, 2021
61 votes
15 answers
2.1K views
How to get current user in asp.net core

I want to get the current user, so I can access fields like their email address. But I can't do that in a

avatar
Percy
0 1 0 9
asked 07 September, 2021
57 votes
6 answers
2.2K views
The default XML namespace of the project must be the MSBuild XML namespace

I cloned the ASP.NET Core SignalR Repo locally, and try opening the solution from within the following environ

avatar
Dwain
0 1 0 9
asked 07 September, 2021