Category "asp.net-mvc"

How to change table name depends on User in EnityFramework?

I would like to change reference to db table depends on model, which would be send by user. For example: I have 3 types (A,B,C) of devices and 3 tables (tableA,

Asp MVC CheckBoxFor help needed in postback validation

Probably I'm missing something in this. I need a checkbox to be checked by the user when he submits a form. If he hasn't check the checkbox I need the ModelStat

Asp MVC CheckBoxFor help needed in postback validation

Probably I'm missing something in this. I need a checkbox to be checked by the user when he submits a form. If he hasn't check the checkbox I need the ModelStat

Integrate Login and Signup with Meta mask in ASP.NET MVC?

I want to Integrate Login and Signup with Meta mask in ASP.NET MVC. looking for it for so long. Checked Metamask tutorial but it has code in node.js and the lib

How to change a key value pair within a nested json structure C#

Hello everyone and thanks for helping me in advance. The following question might sound silly but I'm a beginner about it. I have the following json which comes

Handle File Upload type based on button click in Controller - MVC 5

Is there any way to handle uploading file type based on button clicked in MVC 5 Controller. Currently what is happening is all buttons redirect to same page. Al

Add Integer Data Type in Multipart Form Content C# MVC

using (var multipartFormContent = new MultipartFormDataContent()) { HttpClient httpClient = new HttpClient(); multipartFormContent.Add(

how to fix navbar size to its original

I am trying to make a navbar with dropdown in it. when i added dropdown menu, my navbar's height got big although i commented the dropdown menu code but navbar

select2+ASP.NET+MVC set values back to dropdown in edit mode

i am using select2 plugin with ASP.NET+MVC with multiple select option. i am able to save values into database of selected item. now I want to show those values

set value to select2 which is retrive from database in ASP.NET MVC

i am using select2 control and i want to display or set value which i retrive from database how to set value to select2 which is retrive from database in ASP.NE

Error: System' could not be found (are you missing a using directive or an assembly reference?) in vs 2019

I tried creating a asp.net core web application with mvc in visual code 2019 and as soon as I open it it showes me a lot of errors like in the picture. enter im

Viewbag content does not appear

I have an APS.Net web app Razor view where I attempt to display the Viewbag.errormessage. The action method populates the viewbag but the view does not show the

Render angular.js template on click href

Hei friends,I'm kind rusty on mvc I need help. This is the cshtml ,my html and script is in the same page ,I want to render angular html Without refreshing page

System.Data.Entity.Core.MetadataException: 'Unable to load the specified metadata resource.' 2022

[Enter image description here] 1 I got this error when I tried to run the system. I am not sure why. it used to display the information from a database. Please

Conversion failed when converting the nvarchar value to data type int sql server

I have a table. There is data in this table and there is a checkbox next to each data. Multiple selection is possible. After the user makes a selection, the id

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