Category "asp.net-mvc"

HangFire running each job separately

I am using HangFire to run the job. I have a method that retrieve data from more than 50 sql servers. I want to use HangFire to run each location separately by

I want to know how to make the date automatically change the year only in mvc

I want to know how to make the date automatically change the year only For example, if I have this date in the database 9/21/2020 I want the year to change ever

InvalidOperationException: Model item passed in the ViewDataDictionary is of type 'System.Object'

I encountered the problem when I was creating a Create page. Which lead me to an error message which says: Error Message: Im not entirely sure if my model name

Unable to create an object of type 'AppDbContext'. asp.net 6/mvc

MY ERROR: ı want to "add-migration" but ı cannot also ı use web app and .NET 6.0 Unable to create an object of type 'AppDbContext'. For the diffe

How to dynamically change background-color in ASP.NET MVC core?

I had an idea of changing a background color of a div when I click a button. I added a string in my 'Subject' model class as so: [NotMapped] public string Colo

How to include .aspx and its content into a .cshtml view?

I'm kinda new on .net and I ignored the existence of Controllers, Routing and Views and I already created my pages and their code behind on .aspx files and I wa

Why I am Getting Same Error While Starting Application ? "InvalidOperationException: Unable to resolve service"

Error => An unhandled exception occurred while processing the request. InvalidOperationException: Unable to resolve service for type 'Business_Logic_Layer.Ho

How to make .net 6.0 application to support multiple languages

I need to translate my application to multiple languages. The application is .Net 6.0 - MVC. I have never done this before, however, my idea is to compile the a

.Net Route Action Parameter coming back null despite being in url

UPDATE: It works fine is I add another parameter. I have no idea why. Not sure what I am doing wrong, this route looks the same as the other routes, I've looked

group items accourding to invoice ID

I need to prepare invoice lists and in the each invoice there are more items added by user while shopping here my model public partial class tblNormalSatisBekle

Invalid option '7.3' for /langversion; must be ISO-1, ISO-2, Default or an integer in range 1 to 6

I'm using Visual Studio 17 (version 15.8.5), my project targets .NET Framework 4.8 and I've tried setting the C# version to use (via Build tab in the Properties

Avoid unnecessary include statements in SQL database query for ASP.NET Core

There are some times where I have a user and would like to check whether they are in the organization that owns the item they are trying to access. Let's say th

SSL connection to the postgresql ASP.NET

I am trying to connect to a postgresql database through SSL. In the appsetting.json file, my connection string is "DefaultConnection": "Sslmode=Require;Sslrootc

How do I get the userId to save in the database while submitting the form?

I'm a beginner and well i'm doing a form which is capable to send information to the database but I needed one more thing to be sent and it is the Id from the u

DateTime from view to control to Mapper

i'm trying to pass A DateTime data type to a controller that will call a Mapper to pass it into a db. Additionally the DateTime is taken from a db at first. db

'ZipArchiveEntry' does not contain the definition of 'ExtractToFile'

Using ASP.NET Framework 4.7.1, I am trying to compress a file but Visual Studio is showing that ZipArchiveEntry does not contain the definition of ExtractToFile

With ASP.NET Identity is it possible to add and delete claims dynamically during an existing session?

I'm trying to add and delete claims (roles in this case) dynamically after a successful login using Identity 2 in Asp.Net 4.5.2. My application has an authentic

The type arguments for method 'GridHelper.Grid<T>(HtmlHelper, IEnumerable<T>)' cannot be inferred from the usage. error

I'm getting "The type arguments for method 'GridHelper.Grid(HtmlHelper, IEnumerable)' cannot be inferred from the usage. Try specifying the type arguments expli

Private class method or interface? [closed]

I'm working on an app which uses the Factory pattern to create new objects. In the Factory Class I've added a new Private method called SendAp

How to use anchor tag as submit button in asp.net razor pages

I have a handler method in razor page with name OnGetExpense(UsePayload payload) page.cshtml: <input type="hidden" asp-for="Filters.From" value="@Model.Filte