About 27,200,000 results
Open links in new tab
  1. When to use @using in my razor syntax view in ASP.Net MVC 5

    May 13, 2017 · Every time you need to import a namespace inside your view. This is the same as when you import a namespace in a standard C# code file. So, if you need to use a type which …

  2. Razor syntax reference for ASP.NET Core | Microsoft Learn

    Sep 27, 2024 · Razor is a markup syntax for embedding .NET based code into webpages. The Razor syntax consists of Razor markup, C#, and HTML. Files containing Razor generally have …

  3. Best Practices for Managing Using Statements in Blazor ... - Medium

    Apr 26, 2025 · If you’ve been working with Blazor applications for a while, you’ve likely encountered Razor files and C# classes that have accumulated numerous @using statements.

  4. When to Use @using in Razor Syntax for ASP.NET MVC 5: A

    In this video, we delve into the intricacies of Razor syntax in ASP.NET MVC 5, focusing specifically on the @using directive. Understanding when and how to u...

  5. using statement - ensure the correct use of disposable objects

    Oct 9, 2025 · In particular, the using statement ensures that a disposable instance is disposed even if an exception occurs within the block of the using statement. In the preceding example, …

  6. Using, using, using with C# 8 – blogs.cninnovation.com

    Apr 9, 2019 · Using, using, using with C# 8 C# has different meanings for the using keyword. One is the using directive to import types from namespaces, and to create aliases to types. The …

  7. asp.net - What does @using and @namespace directives do in a …

    May 14, 2018 · @using is used to add imports for all views within the folder. For example: if your _ViewImports.cshtml file contains @using Microsoft.AspNetCore.Identity, then any views …

  8. Razor compiler doesn't understand "@using Alias = Namespace ... - GitHub

    Aug 13, 2019 · If I want to rename/alias a Razor component when using it in a Razor page/Razor component, I should be able to reference it using the alias syntax, @using Alias = …

  9. Blazor University - Directives

    Directives are used by preceding the identifier with the @ symbol, the identifier being what we'd typically expect to be either the name of an HTML attribute or the name of a component's …

  10. The using directive: Import types from a namespace - C# reference

    Jan 27, 2025 · The `using` directive imports types from a namespace, or creates an alias for a given type. Using directives enable you to use simple names for types instead of the fully …