Category "asp.net"

How to use DBContextFactory in Generic Repository

My current application has three layers: Web, Infrastructure and Core. Generic Repository is in Infrasturcture layer and works fine with DBContext. After I swit

How to Update the .config file using Azure DevOps "Update config" Task

I want to Update the Web.config file using Azure DevOps Release Pipeline. I am using [Update Config][1] Task from MarketPlace. [1]: https://marketplace.visualst

Docker .NET Framework is triggering error Access to the path 'C:\RoslynCompilers-3.6.0\tools\csc.exe' is denied

I am trying to run a simple ASP.NET application in a Docker Container. Unfortunately, this application is a .NET Framework (not .NET Core), and because of that,

Open the same app after downloading an a update

i'm doing a application update, and i've already code the part thats download and extracts content. now, i need to close current app, and open the same, but wit

How to declare scalar variable?

I get this error: System.Data.SqlClient.SqlException: 'Must declare the scalar variable "@refSlips".' Code: SqlConnection con = new SqlConnection(connectionSt

Blazor Server set multiple default values for select drop down list

I have a Blazor server app (.net 6) page that has a select drop down list, which is set to allow multiple selected items. I need to set default values, when th

Visual Studio 2022 Crashes when Adding SqlDataSource using any MS Access Database in ASP.NET C# Web Project

When adding a "SqlDataSource" using any version of MS Access database the app simply crashes when you "Test Connection". This happens in the designer when usin

Give two sql queries in asp.net controller

This is function from my ASP.NET mvc structure and i want to give two queries in same function.My task is to delete row from 'class' table also when row is del

Log HttpContext.Response.Headers on OnActionExecuted in .NET 6

I'm trying to create an attribute [LogRequest] which will log HTTP request and response with headers. Action controller [HttpGet] [Route("GetCourse")] [LogRequ

ASP.NET MVC - Populate SelectList with Font-Awesome Icons

I've populated List with font-awesome strings like: private static readonly List<string> Icons = new(){ "<i class=\"fas fa-users\"></i>",

Using ASPNET_REGIIS to encrypt system.webserver / rewrite / providers

I'm using ASPNET_REGIIS to encrypt different subsections of my web.config file. I can encrypt the SMTP password using: ASPNET_REGIIS -pef "system.net/mailSettin

ASP.Net Core Email Breaks Suddenly Citing SSL Time Mismatch

After noticing that nobody has signed up for a site of mine for a week I tried signing up myself only to be greeted with an error message. Then I tried signing

How do i load CheckBoxList from a Selected Value from DropDownList?

i'm trying to do a display database's item(tables, rows, fk,...). I'm stucking at first few step. I loaded the db's names into a DropDownList. But i tried to lo

Use Browser Search (Ctrl+F) through a button in website?

I have created a website and have added a button and lot of text. What I want is to use the browser search (Ctrl+F), when I press the button which I added in we

How can I read in an edited textarea?

I'm trying to get the new textarea value to read into my controller so that way I can store the new value in my SQl database. View: @{ ViewBag.Title = "TRIO

How can I reproduce Serilog's LogContext behavior?

this is a question of functioning issue, because I didn't understand correctly how you use information sharing. I'm wanting to do something similar to LogContex

.NET Core 3.1 Writing file to network drive

I am trying to get user to upload a document from the web interface and have it stored on the network share *\dfsms\shared\MyProject* , it also saves the entry

Upload File from Angular to .Net

I am trying make a post with my form along with a file. I tried see others posts but without result. If I make the post without the file, works just fine. Engli

How to run asp.net web api with docker container without https?

I am trying to run an asp.net web api with docker container but I get status code 400 (Bad request) as the response when I send a request to the api. The api w

how can I preserve my class after list clear

I have 2 classes public class Product { public DateTime Date { get; set; } public string Name { get; set; } public int Amount { get; set; } } publi