Relative Content

Tag Archive for c#asp.net.netasp.net-core

Header based routing in ASP.NET Core minimal API

I’m looking for a way to have multiple routes in my ASP.NET Core which differ by a certain header. I found this question which answers the same question BUT for Controllers API: Header based routing in ASP.NET Core

What does it mean ReferenceLoopHandling

builder.Services.AddControllers().AddNewtonsoftJson(options => { options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; }); what does it mean in c# or .net i have saw on code while reviewing c# asp.net .net asp.net-core New contributor Rohan Sharma is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct. 1

Adding Chat Widget built in .Net Core 6 to asp.net 3.5 project

So I have a web app built on asp.net 3.5 (still uses Global.asax, aspx pages etc) and I have a .net Core 6 chat widget that I want to be imported for use in this project. Is this possible? I’ve been searching and I’m not coming up with any specific answers to this case.

My file downloads but not showing download dialog in browsers

I have a project, .NET Core 7 for the backend and NextJs for the frontend. Based on user’s need and requirements, there are many files (as videos with .mp4 format) in my windows VPS saved inside a folder with their unique name. When user clicks on download using their device, these videos start downloading automatically. Right now, almost everything works fine in terms of downloading video. There is a small problem that I have no idea where it is coming from. I want when a user clicks on download, the download dialog of the browser shows the file that is being downloaded. Right now, the way it works is first it downloads completely, after completion informs the user that your file is downloaded completely.
I was searching for the similar problem, I figured out that I have to add “Content-Disposition” header with “attachment” and my file name. Even though I added that to my header, still it downloads, then it shows the completed dialog.
Down below is my code: