Loading comparison...
Loading comparison...
ASP.NET's template syntax mixing C# with HTML. Used in Razor Pages and Blazor component development.
Microsoft created Razor syntax in 2010 as part of ASP.NET MVC 3, designed by Scott Guthrie's team to provide a clean, compact way to embed C# server-side code within HTML markup. Razor uses the @ symbol as a transition character between HTML and C# code, allowing developers to write dynamic web pages without the verbose delimiters that plagued earlier technologies like Web Forms and classic ASP. The syntax powers two major ASP.NET paradigms: Razor Pages for page-focused web applications and Blazor for building interactive web UIs with C# instead of JavaScript. In Blazor, Razor components (.razor files) define reusable UI elements with parameters, event handlers, lifecycle methods, and two-way data binding, running either server-side over SignalR or client-side via WebAssembly.
Razor's design philosophy minimizes ceremony — the parser intelligently transitions between markup and code contexts, inferring boundaries without explicit closing tags in most cases. The syntax supports layouts, partial views, sections, tag helpers, and view components for composing complex page hierarchies. Razor integrates deeply with ASP.NET's dependency injection, model binding, and validation systems. Visual Studio and JetBrains Rider provide rich IntelliSense, syntax highlighting, and debugging support for Razor files.
The format has become the standard view layer across the entire .NET web ecosystem, from traditional MVC applications to modern Blazor SPAs, and even extends to generating emails and PDFs through templating libraries. ASP.NET Core's cross-platform capabilities mean Razor runs on Windows, Linux, and macOS.
Razor files interleave C# logic with HTML markup, meaning a single change can affect both server behavior and rendered output simultaneously. Comparing Razor files catches modified @inject directives that change dependency resolution, altered event handler bindings that break user interactions, changed conditional rendering blocks that hide or expose UI sections, and updated component parameter types that break parent-child contracts.
Teams reviewing Blazor component changes need to verify that both the C# logic and the resulting HTML are correct.
UtraDiff compares Razor files with syntax highlighting that distinguishes C# code blocks (@{ }), inline expressions (@Model.Property), HTML markup, and tag helpers. Side-by-side view separates server-side logic changes from presentation markup modifications, making it clear whether a diff affects data binding or layout.
Inline view consolidates changes across @if/@foreach control structures. Alt+arrow navigation jumps between changed code sections, streamlining ASP.NET and Blazor component reviews.
Supported extensions: .cshtml .razor