Skip to content

Blazor University

Learn the new .NET SPA framework from Microsoft

  • Hire me
  • Search Results
  • Introduction
    • What is Blazor?
    • What is WebAssembly?
    • Blazor hosting models
    • Installing Blazor
    • Creating a new project
    • Creating a page
  • Layouts
    • Creating a Blazor layout
    • Using a layout
    • Nested layouts
  • Components
    • Creating a component
    • One-way binding
    • Literals, expressions, and directives
      • Directives
    • Component events
      • Browser DOM events
    • Two-way binding
      • Binding directives
    • Cascading values
      • Cascading values by name
      • Cascading values by type
      • Overriding cascaded values
    • Code generated HTML attributes
    • Capturing unexpected parameters
    • Replacing attributes on child components
    • Component lifecycles
    • Creating components with Generics
    • Code-behind
    • Multi-threaded rendering
      • Thread safety using InvokeAsync
    • Render trees
      • Incremental RenderTree proof
      • Optimising using @key
  • Templating components with RenderFragments
    • Creating a TabControl
    • Passing data to a RenderFragment
    • Using @typeparam to create generic components
    • Passing placeholders to RenderFragments
  • Routing
    • Defining routes
    • Route parameters
    • Constraining route parameters
    • Optional route parameters
    • 404 – Not found
    • Navigating our app via HTML
    • Navigating our app via code
    • Detecting navigation events
  • Forms
    • Editing form data
    • Descending from InputBase<T>
    • Validation
    • Accessing form state
    • Handling form submission
    • EditContext, FieldIdentifiers, and FieldState
    • Writing custom validation
  • Component libraries
  • JavaScript interop
    • JavaScript boot process
    • Calling JavaScript from .NET
      • Updating the document title
      • Passing HTML element references
    • Calling .NET From JavaScript
      • Lifetimes and memory leaks
      • Type safety
      • Calling static .NET methods
  • Dependency injection
    • Injecting dependencies into Blazor components
    • Dependency lifetimes and scopes
      • Transient dependencies
      • Singleton dependencies
      • Scoped dependencies
      • Comparing dependency scopes
    • Component scoped dependencies
      • OwningComponentBase<T>
      • Owning multiple dependencies: The wrong way
      • Owning multiple dependencies: The right way
  • Terms of service
Blazor in action
Book recommendation Blazor in action
This is a personal recommendation, not a paid advert.

Code-behind

What is Blazor?

Love retro?

Table of contents

  • Introduction
    • What is Blazor?
    • What is WebAssembly?
    • Blazor hosting models
    • Installing Blazor
    • Creating a new project
    • Creating a page
  • Layouts
    • Creating a Blazor layout
    • Using a layout
    • Nested layouts
  • Components
    • Creating a component
    • One-way binding
    • Literals, expressions, and directives
      • Directives
    • Component events
      • Browser DOM events
    • Two-way binding
      • Binding directives
    • Cascading values
      • Cascading values by name
      • Cascading values by type
      • Overriding cascaded values
    • Code generated HTML attributes
    • Capturing unexpected parameters
    • Replacing attributes on child components
    • Component lifecycles
    • Multi-threaded rendering
      • Thread safety using InvokeAsync
  • Render trees
    • Incremental RenderTree proof
    • Optimising using @key
  • Templating components with RenderFragments
    • Creating a TabControl
    • Passing data to a RenderFragment
    • Using @typeparam to create generic components
    • Passing placeholders to RenderFragments
  • Routing
    • Defining routes
    • Route parameters
    • Constraining route parameters
    • Optional route parameters
    • 404 – Not found
    • Navigating our app via HTML
    • Navigating our app via code
    • Detecting navigation events
  • Forms
    • Editing form data
    • Descending from InputBase
    • Validation
    • Handling form submission
    • EditContext, FieldIdentifiers, and FieldState
    • Accessing form state
    • Writing custom validation
  • Component libraries
  • JavaScript interop
    • JavaScript boot process
    • Calling JavaScript from .NET
      • Updating the document title
      • Passing HTML element references
    • Calling .NET From JavaScript
      • Lifetimes and memory leaks
      • Type safety
      • Calling static .NET methods
  • Dependency injection
    • Injecting dependencies into Blazor components
    • Dependency lifetimes and scopes
      • Transient dependencies
      • Singleton dependencies
      • Scoped dependencies
      • Comparing dependency scopes
    • Component scoped dependencies
      • OwningComponentBase
      • Owning multiple dependencies: The wrong way
      • Owning multiple dependencies: The right way

© 2019-2022 Peter Morris

Back to top