All Questions
Tagged with razor visual-studio
359
questions
2
votes
1
answer
28
views
Strange Strings in HTML Code of New ASP.NET Core Razor Projects in Visual Studio 2022
I'm encountering an issue when creating new ASP.NET Core web app (Razor) projects using Visual Studio 2022 (Community Edition 17.10.4) with .NET 8.0. Without making any modifications, I see strange ...
0
votes
0
answers
91
views
The @ symbol does not escape properly in razor views in VS2022 17.10.1
In a razor view (.cshtml) of an ASP.NET Core 8.0 MVC web application, I have this markup and code:
@{
var DropDownList = new Syncfusion.EJ2.DropDowns.DropDownList() { ... }
}
<e-grid-column ... ...
0
votes
1
answer
67
views
Visual Studio Doesn't Publish Modified Files With Unchanged Line Count
I have a large web project (Razor based) and I recently had to make changes to many files that DID NOT change the number of lines in those files. When I did a publish, none of those files were ...
1
vote
0
answers
117
views
Navigation to file on parameter with Custom Helpers for cshtml
I have a custom helper @Url.Content("./customfolder/typescript.ts", ContentExtension.ToJs) that alters the file and directory. But I lose the functionality to navigate to the original file.
...
0
votes
0
answers
54
views
Resolving Color Inconsistencies and Accessibility Issues with Razor Components in .NET 6 Project
I'm conducting research to solve an issue in my .NET 6 project. I'm experiencing some inconsistencies and color problems in Visual Studio regarding a razor library I've added to my main project. ...
0
votes
0
answers
22
views
Automatically create related CSS file for Razor Component
Is there any way to tell Visual Studio to automatically create a CSS file when I create a new Razor Component?
For example:
When I create the file:
Component.razor
I want Visual Studio to ...
0
votes
1
answer
45
views
Question | Visual Studio Code Editor .cshtml file not working properly
I'm trying to create small app on .Net but i faced problem while working on .cshtml file.
On this file, I cant format doccument and my property names not come automatically. For instance, ProductPrice ...
0
votes
1
answer
28
views
Forcing "server" comments on Visual Studio
On Visual Studio 2022, I am programming a website in asp.net core 8 C#.
Trying to comment some code via the button in the top bar, I get a "javascript" style comment if I am in javascript ...
0
votes
0
answers
38
views
Error when loading Nuget packages in ASP.NET projects "Unable to load the service index for source https://api.nuget.org/v3index.json"
Im trying to follow the steps to make the ContosoUniversity project on https://learn.microsoft.com/fr-fr/aspnet/core/data/ef-rp/intro?view=aspnetcore-6.0&tabs=visual-studio.
When i try to scaffold ...
0
votes
0
answers
54
views
Blazor code colors showing strange behavior in VS
I'm having some strange behavior with colors being applied by Visual Studio 2022 (17.8.2) for Blazor syntax:
Other examples:
Any idea what I can do to fix this? FYI: the code runs perfectly ^^
0
votes
0
answers
39
views
cshtml file has no attached C# file
I have a Razor page with the .cshtml file extension.
Register.cshtml
@using Project.Models.Auth
@model RegisterModel
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<...
0
votes
0
answers
63
views
Razor Wrap Attributes in Visual Studio
Which Visual Studio Configuration is needed to wrap attributes in Razor/Blazor components?
Instead of
<SampleComponent Message="Welcome to Blazor" IsVisible="true" Count="...
0
votes
0
answers
13
views
Does Visual Studio have a "don't format my cshtml at all" option
Below is an example of how my code routinely gets formatted in cshtml by Visual Studio. I'd like an option that says, just leave my code completely alone, I'll format it how I want
You'd think this ...
0
votes
1
answer
26
views
How to update shared view adminheader.cshtml from a model
I've added a drop down into my shared adminheader.cshtl view and it needs to be dynamically updated from data from a table. So when I use another view like routeplan.cshtml I load the view from ...
1
vote
0
answers
37
views
Is there a way to click on .js file in the CSHTML editor and have it open?
In Visual Studio 2022, in a foo.cshtml file, I reference a number of .js files.
I would like to be able to click or Ctrl+click on neutrals.js and have Visual Studio open the file (as opposed to me ...