Category "asp.net-mvc"

What's the difference between Render and GetHtml methods in DevExpress?

I would like to know whats the difference between using the method Render vs. using the method GetHtml, when using the DevExpress MVC Extensions? I know that Ge

Views not found after migrating to .NET 6

I migrated an ASP.NET CORE MVC project from .NET Core 2.1 to .NET 6. After making relevant changes, the project compiles and starts seemingly OK, but the views

How to configure the web.config to allow requests of any length

I am building a site in which i would like to create a file client side from the value of a textarea element. I have the code in place to do this, but i am get

HttpContext.User.Identity.IsAuthenticated throws System.NullReferenceException: Object reference not set to an instance of an object

My code is simple like : [HttpGet] public ActionResult Login () { if (User.Identity.IsAuthenticated) { return RedirectToAction("Index", "Home");

CSS, Images, JS not loading in IIS

My all applications were working fine but suddenly all sites under IIS are not loading css, images, scripts. It redirect to login page. If i login it works fi

How to apply Bootstrap dropdown style to an ASP.NET MVC DropDownList?

Given is the following MVC razor code which creates a dropdown from a list: @Html.DropDownList("MyTestList", null, new { @class = "btn btn-default dropdown-to

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 environment. IDE Microsoft Visual Studio Enterprise 201

How can I pass a String as a model to a View in MVC 5?

I have an action defined like this: public ActionResult TempOutput(string model) { return View(model); } And also, I have its view define

Adding nonce value to @Scripts.Render ASP.Net MVC razor pages with NWebSec

I am trying to implement Content-Security-Policy with the NWebSec NuGet package The basic configuration level is working at this moment but trying to add nonce

Make sure that the controller has a parameterless public constructor error

I have followed this tutorial which has worked great, until I modified my DbContext to have an additional constructor. I am now having issues with the resolutio

How to check radiobutton with Enum value in Asp.net core mvc view?

I have rendered my view like below <div class="row row-margin-zero"> <label class="radio-inline margin-rightt-ten margin-leftt-five margin-top-none

Microsoft Exchange WebService Contact Email Addresses formatting

I have set up a microsoft exchange web service to allow me to send and receive data to and from my Microsoft Outlook account. I am attempting to get the saved

Telegram login widget return "bot domain invalid" in my mvc app

I use telegram login widget in MVC App , and follow steps as in post telegram-web-login-widget-setdomain-does-not-work Steps As in Post Here is how the di

The type initializer for 'System.Data.Entity.Migrations.DbMigrationsConfiguration`1' threw an exception

I have ASP.Net MVC site. Technology Stack ASP.Net 4.6 C#.Net EF 6 MySQL -Database While I am trying to generate the database using Nuget command:- Enable-Mi

Some (official or not) upgrade Mvc3 to Mvc5 guide?

There is a (non-Microsoft) NuGet package that allows upgrading the Mvc3 to Mvc4. There is a (Microsoft) article that explains how to manually migrate from Mvc3

Set value from model in a label using html helper

I have given view model.I have to set the value of Amount(which is getting retrieved from table using linq) on a label using Html helper. public class Allocat

Only last radio button control in list being set as checked

I have a list with each element of the list containing a star rating control which allows the user to set their preference for that element. The rating control

Prevent database access outside the application

We have a MVC application running with SQL Server database. We are using windows authentication, and when we want to give user access to our site we add them i

Using CSVHelper to output stream to browser

I'm trying to use CSVHelper to generate a CSV file and send it back to a browser, so the user can select a save location and filename and save the data. The w

Form within a foreach loop not posting the model back to the controller

I've searched around and can't find an answer to my problem. I've got a View that takes accepts Foo in like so: @model IEnumerable<MyApplication.Models.Foo