You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/blazor/components.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -164,7 +164,7 @@ The following `ParentComponent` can provide content for rendering the `ChildComp
164
164
165
165
## Attribute splatting and arbitrary parameters
166
166
167
-
Components can capture and render additional attributes in addition to the component's declared parameters. Additional attributes can be captured in a dictionary and then *splatted* onto an element when the component is rendered using the [@attributes](xref:mvc/views/razor#attributes) Razor directive. This scenario is useful when defining a component that produces a markup element that supports a variety of customizations. For example, it can be tedious to define attributes separately for an `<input>` that supports many parameters.
167
+
Components can capture and render additional attributes in addition to the component's declared parameters. Additional attributes can be captured in a dictionary and then *splatted* onto an element when the component is rendered using the [`@attributes`](xref:mvc/views/razor#attributes) Razor directive. This scenario is useful when defining a component that produces a markup element that supports a variety of customizations. For example, it can be tedious to define attributes separately for an `<input>` that supports many parameters.
168
168
169
169
In the following example, the first `<input>` element (`id="useIndividualParams"`) uses individual component parameters, while the second `<input>` element (`id="useAttributesDict"`) uses attribute splatting:
170
170
@@ -280,7 +280,7 @@ The rendered `<div>` in the `Parent` component contains `extra="10"` when passed
280
280
281
281
## Data binding
282
282
283
-
Data binding to both components and DOM elements is accomplished with the [@bind](xref:mvc/views/razor#bind) attribute. The following example binds a `CurrentValue` property to the text box's value:
283
+
Data binding to both components and DOM elements is accomplished with the [`@bind`](xref:mvc/views/razor#bind) attribute. The following example binds a `CurrentValue` property to the text box's value:
284
284
285
285
```cshtml
286
286
<input @bind="CurrentValue" />
@@ -308,7 +308,7 @@ Using `@bind` with the `CurrentValue` property (`<input @bind="CurrentValue" />`
308
308
309
309
When the component is rendered, the `value` of the input element comes from the `CurrentValue` property. When the user types in the text box and changes element focus, the `onchange` event is fired and the `CurrentValue` property is set to the changed value. In reality, the code generation is more complex because `@bind` handles cases where type conversions are performed. In principle, `@bind` associates the current value of an expression with a `value` attribute and handles changes using the registered handler.
310
310
311
-
In addition to handling `onchange` events with `@bind` syntax, a property or field can be bound using other events by specifying an [@bind-value](xref:mvc/views/razor#bind) attribute with an `event` parameter ([@bind-value:event](xref:mvc/views/razor#bind)). The following example binds the `CurrentValue` property for the `oninput` event:
311
+
In addition to handling `onchange` events with `@bind` syntax, a property or field can be bound using other events by specifying an [`@bind-value`](xref:mvc/views/razor#bind) attribute with an `event` parameter ([`@bind-value:event`](xref:mvc/views/razor#bind)). The following example binds the `CurrentValue` property for the `oninput` event:
@@ -377,7 +377,7 @@ For information on how to set the user's culture, see the [Localization](#locali
377
377
378
378
**Format strings**
379
379
380
-
Data binding works with <xref:System.DateTime> format strings using [@bind:format](xref:mvc/views/razor#bind). Other format expressions, such as currency or number formats, aren't available at this time.
380
+
Data binding works with <xref:System.DateTime> format strings using [`@bind:format`](xref:mvc/views/razor#bind). Other format expressions, such as currency or number formats, aren't available at this time.
@@ -491,7 +491,7 @@ In general, a property can be bound to a corresponding event handler using `@bin
491
491
492
492
## Event handling
493
493
494
-
Razor components provide event handling features. For an HTML element attribute named `on{EVENT}` (for example, `onclick` and `onsubmit`) with a delegate-typed value, Razor components treats the attribute's value as an event handler. The attribute's name is always formatted [@on{EVENT}](xref:mvc/views/razor#onevent).
494
+
Razor components provide event handling features. For an HTML element attribute named `on{EVENT}` (for example, `onclick` and `onsubmit`) with a delegate-typed value, Razor components treats the attribute's value as an event handler. The attribute's name is always formatted [`@on{EVENT}`](xref:mvc/views/razor#onevent).
495
495
496
496
The following code calls the `UpdateHeading` method when the button is selected in the UI:
497
497
@@ -644,7 +644,7 @@ Prefer the strongly typed `EventCallback<T>` over `EventCallback`. `EventCallbac
644
644
645
645
### Prevent default actions
646
646
647
-
Use the [@on{EVENT}:preventDefault](xref:mvc/views/razor#oneventpreventdefault) directive attribute to prevent the default action for an event.
647
+
Use the [`@on{EVENT}:preventDefault`](xref:mvc/views/razor#oneventpreventdefault) directive attribute to prevent the default action for an event.
648
648
649
649
When a key is selected on an input device and the element focus is on a text box, a browser normally displays the key's character in the text box. In the following example, the default behavior is prevented by specifying the `@onkeypress:preventDefault` directive attribute. The counter increments, and the **+** key isn't captured into the `<input>` element's value:
650
650
@@ -676,7 +676,7 @@ An event handler isn't required to prevent the default action. The event handler
676
676
677
677
### Stop event propagation
678
678
679
-
Use the [@on{EVENT}:stopPropagation](xref:mvc/views/razor#oneventstoppropagation) directive attribute to stop event propagation.
679
+
Use the [`@on{EVENT}:stopPropagation`](xref:mvc/views/razor#oneventstoppropagation) directive attribute to stop event propagation.
680
680
681
681
In the following example, selecting the check box prevents click events from the second child `<div>` from propagating to the parent `<div>`:
682
682
@@ -834,7 +834,7 @@ Password:
834
834
835
835
Component references provide a way to reference a component instance so that you can issue commands to that instance, such as `Show` or `Reset`. To capture a component reference:
836
836
837
-
* Add an [@ref](xref:mvc/views/razor#ref) attribute to the child component.
837
+
* Add an [`@ref`](xref:mvc/views/razor#ref) attribute to the child component.
838
838
* Define a field with the same type as the child component.
839
839
840
840
```cshtml
@@ -1019,7 +1019,7 @@ Optional parameters aren't supported, so two `@page` directives are applied in t
1019
1019
1020
1020
Razor components are generated as partial classes. Razor components are authored using either of the following approaches:
1021
1021
1022
-
* C# code is defined in an [@code](xref:mvc/views/razor#code) block with HTML markup and Razor code in a single file. Blazor templates define their Razor components using this approach.
1022
+
* C# code is defined in an [`@code`](xref:mvc/views/razor#code) block with HTML markup and Razor code in a single file. Blazor templates define their Razor components using this approach.
1023
1023
* C# code is placed in a code-behind file defined as a partial class.
1024
1024
1025
1025
The following example shows the default `Counter` component with an `@code` block in an app generated from a Blazor template. HTML markup, Razor code, and C# code are in the same file:
@@ -1118,13 +1118,13 @@ The base class should derive from `ComponentBase`.
1118
1118
1119
1119
The namespace of a component authored with Razor is based on (in priority order):
1120
1120
1121
-
*[@namespace](xref:mvc/views/razor#namespace) designation in Razor file (*.razor*) markup (`@namespace BlazorSample.MyNamespace`).
1121
+
*[`@namespace`](xref:mvc/views/razor#namespace) designation in Razor file (*.razor*) markup (`@namespace BlazorSample.MyNamespace`).
1122
1122
* The project's `RootNamespace` in the project file (`<RootNamespace>BlazorSample</RootNamespace>`).
1123
1123
* The project name, taken from the project file's file name (*.csproj*), and the path from the project root to the component. For example, the framework resolves *{PROJECT ROOT}/Pages/Index.razor* (*BlazorSample.csproj*) to the namespace `BlazorSample.Pages`. Components follow C# name binding rules. For the `Index` component in this example, the components in scope are all of the components:
1124
1124
* In the same folder, *Pages*.
1125
1125
* The components in the project's root that don't explicitly specify a different namespace.
1126
1126
1127
-
Components defined in a different namespace are brought into scope using Razor's [@using](xref:mvc/views/razor#using) directive.
1127
+
Components defined in a different namespace are brought into scope using Razor's [`@using`](xref:mvc/views/razor#using) directive.
1128
1128
1129
1129
If another component, `NavMenu.razor`, exists in the *BlazorSample/Shared/* folder, the component can be used in `Index.razor` with the following `@using` statement:
1130
1130
@@ -1136,7 +1136,7 @@ This is the Index page.
1136
1136
<NavMenu></NavMenu>
1137
1137
```
1138
1138
1139
-
Components can also be referenced using their fully qualified names, which doesn't require the [@using](xref:mvc/views/razor#using) directive:
1139
+
Components can also be referenced using their fully qualified names, which doesn't require the [`@using`](xref:mvc/views/razor#using) directive:
1140
1140
1141
1141
```cshtml
1142
1142
This is the Index page.
@@ -1265,7 +1265,7 @@ Alternatively, you can specify the `Context` attribute on the component element.
1265
1265
1266
1266
### Generic-typed components
1267
1267
1268
-
Templated components are often generically typed. For example, a generic `ListViewTemplate` component can be used to render `IEnumerable<T>` values. To define a generic component, use the [@typeparam](xref:mvc/views/razor#typeparam) directive to specify type parameters:
1268
+
Templated components are often generically typed. For example, a generic `ListViewTemplate` component can be used to render `IEnumerable<T>` values. To define a generic component, use the [`@typeparam`](xref:mvc/views/razor#typeparam) directive to specify type parameters:
Copy file name to clipboardExpand all lines: aspnetcore/blazor/handle-errors.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,7 +108,7 @@ The preceding unhandled exceptions are described in the following sections of th
108
108
When Blazor creates an instance of a component:
109
109
110
110
* The component's constructor is invoked.
111
-
* The constructors of any non-singleton DI services supplied to the component's constructor via the [@inject](xref:blazor/dependency-injection#request-a-service-in-a-component) directive or the [[Inject]](xref:blazor/dependency-injection#request-a-service-in-a-component) attribute are invoked.
111
+
* The constructors of any non-singleton DI services supplied to the component's constructor via the [`@inject`](xref:blazor/dependency-injection#request-a-service-in-a-component) directive or the [`[Inject]`](xref:blazor/dependency-injection#request-a-service-in-a-component) attribute are invoked.
112
112
113
113
A circuit fails when any executed constructor or a setter for any `[Inject]` property throws an unhandled exception. The exception is fatal because the framework can't instantiate the component. If constructor logic may throw exceptions, the app should trap the exceptions using a [try-catch](/dotnet/csharp/language-reference/keywords/try-catch) statement with error handling and logging.
114
114
@@ -177,7 +177,7 @@ The following conditions apply to error handling with `InvokeAsync<T>`:
177
177
* If a call to `InvokeAsync<T>` fails asynchronously, the .NET <xref:System.Threading.Tasks.Task> fails. A call to `InvokeAsync<T>` may fail, for example, because the JavaScript-side code throws an exception or returns a `Promise` that completed as `rejected`. Developer code must catch the exception. If using the [await](/dotnet/csharp/language-reference/keywords/await) operator, consider wrapping the method call in a [try-catch](/dotnet/csharp/language-reference/keywords/try-catch) statement with error handling and logging. Otherwise, the failing code results in an unhandled exception that's fatal to the circuit.
178
178
* By default, calls to `InvokeAsync<T>` must complete within a certain period or else the call times out. The default timeout period is one minute. The timeout protects the code against a loss in network connectivity or JavaScript code that never sends back a completion message. If the call times out, the resulting `Task` fails with an <xref:System.OperationCanceledException>. Trap and process the exception with logging.
179
179
180
-
Similarly, JavaScript code may initiate calls to .NET methods indicated by the [[JSInvokable] attribute](xref:blazor/javascript-interop#invoke-net-methods-from-javascript-functions). If these .NET methods throw an unhandled exception:
180
+
Similarly, JavaScript code may initiate calls to .NET methods indicated by the [`[JSInvokable]`](xref:blazor/javascript-interop#invoke-net-methods-from-javascript-functions) attribute. If these .NET methods throw an unhandled exception:
181
181
182
182
* The exception isn't treated as fatal to the circuit.
Copy file name to clipboardExpand all lines: aspnetcore/blazor/state-management.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -150,7 +150,7 @@ To install the `Microsoft.AspNetCore.ProtectedBrowserStorage` package:
150
150
151
151
### Save and load data within a component
152
152
153
-
In any component that requires loading or saving data to browser storage, use [@inject](xref:blazor/dependency-injection#request-a-service-in-a-component) to inject an instance of either of the following:
153
+
In any component that requires loading or saving data to browser storage, use [`@inject`](xref:blazor/dependency-injection#request-a-service-in-a-component) to inject an instance of either of the following:
Copy file name to clipboardExpand all lines: aspnetcore/blazor/templates.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ The following files and folders make up a Blazor app generated from a Blazor tem
53
53
54
54
**App.razor*– The root component of the app that sets up client-side routing using the <xref:Microsoft.AspNetCore.Components.Routing.Router> component. The `Router` component intercepts browser navigation and renders the page that matches the requested address.
55
55
56
-
**Pages* folder – Contains the routable components/pages (*.razor*) that make up the Blazor app. The route for each page is specified using the [@page](xref:mvc/views/razor#page) directive. The template includes the following components:
56
+
**Pages* folder – Contains the routable components/pages (*.razor*) that make up the Blazor app. The route for each page is specified using the [`@page`](xref:mvc/views/razor#page) directive. The template includes the following components:
57
57
*`Index` (*Index.razor*) – Implements the Home page.
58
58
*`Counter` (*Counter.razor*) – Implements the Counter page.
59
59
*`Error` (*Error.razor*, Blazor Server app only) – Rendered when an unhandled exception occurs in the app.
@@ -63,7 +63,7 @@ The following files and folders make up a Blazor app generated from a Blazor tem
63
63
*`MainLayout` (*MainLayout.razor*) – The app's layout component.
64
64
*`NavMenu` (*NavMenu.razor*) – Implements sidebar navigation. Includes the [NavLink component](xref:blazor/routing#navlink-component) (<xref:Microsoft.AspNetCore.Components.Routing.NavLink>), which renders navigation links to other Razor components. The `NavLink` component automatically indicates a selected state when its component is loaded, which helps the user understand which component is currently displayed.
65
65
66
-
**_Imports.razor*– Includes common Razor directives to include in the app's components (*.razor*), such as [@using](xref:mvc/views/razor#using) directives for namespaces.
66
+
**_Imports.razor*– Includes common Razor directives to include in the app's components (*.razor*), such as [`@using`](xref:mvc/views/razor#using) directives for namespaces.
67
67
68
68
**Data* folder (Blazor Server) – Contains the `WeatherForecast` class and implementation of the `WeatherForecastService` that provide example weather data to the app's `FetchData` component.
Copy file name to clipboardExpand all lines: aspnetcore/data/ef-rp/intro/samples/cu/wwwroot/lib/bootstrap/README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,11 +109,11 @@ Editor preferences are available in the [editor config](https://github.com/twbs/
109
109
110
110
Get updates on Bootstrap's development and chat with the project maintainers and community members.
111
111
112
-
* Follow [@getbootstrap on Twitter](https://twitter.com/getbootstrap).
112
+
* Follow [`@getbootstrap` on Twitter](https://twitter.com/getbootstrap).
113
113
* Read and subscribe to [The Official Bootstrap Blog](http://blog.getbootstrap.com).
114
114
* Join [the official Slack room](https://bootstrap-slack.herokuapp.com).
115
115
* Chat with fellow Bootstrappers in IRC. On the `irc.freenode.net` server, in the `##bootstrap` channel.
116
-
* Implementation help may be found at Stack Overflow (tagged [`twitter-bootstrap-3`](https://stackoverflow.com/questions/tagged/twitter-bootstrap-3)).
116
+
* Implementation help may be found at Stack Overflow (tagged [twitter-bootstrap-3](https://stackoverflow.com/questions/tagged/twitter-bootstrap-3)).
117
117
* Developers should use the keyword `bootstrap` on packages which modify or add to the functionality of Bootstrap when distributing through [npm](https://www.npmjs.com/browse/keyword/bootstrap) or similar delivery mechanisms for maximum discoverability.
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/error-handling.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -161,7 +161,7 @@ The endpoint that processes the error can get the original URL that generated th
161
161
162
162
## Disable status code pages
163
163
164
-
To disable status code pages for an MVC controller or action method, use the [[SkipStatusCodePages]](xref:Microsoft.AspNetCore.Mvc.SkipStatusCodePagesAttribute) attribute.
164
+
To disable status code pages for an MVC controller or action method, use the [`[SkipStatusCodePages]`](xref:Microsoft.AspNetCore.Mvc.SkipStatusCodePagesAttribute) attribute.
165
165
166
166
To disable status code pages for specific requests in a Razor Pages handler method or in an MVC controller, use <xref:Microsoft.AspNetCore.Diagnostics.IStatusCodePagesFeature>:
Copy file name to clipboardExpand all lines: aspnetcore/fundamentals/startup.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: Learn how the Startup class in ASP.NET Core configures services and
5
5
monikerRange: '>= aspnetcore-2.1'
6
6
ms.author: riande
7
7
ms.custom: mvc
8
-
ms.date: 11/02/2019
8
+
ms.date: 12/05/2019
9
9
uid: fundamentals/startup
10
10
---
11
11
# App startup in ASP.NET Core
@@ -37,7 +37,7 @@ The preceding sample is for [Razor Pages](xref:razor-pages/index); the MVC versi
37
37
38
38
::: moniker-end
39
39
40
-
The `Startup` class is specified when the app's [host](xref:fundamentals/index#host) is built. The `Startup` class is typically specified by calling the [`WebHostBuilderExtensions.UseStartup<TStartup>`](xref:Microsoft.AspNetCore.Hosting.WebHostBuilderExtensions.UseStartup*) method on the host builder:
40
+
The `Startup` class is specified when the app's [host](xref:fundamentals/index#host) is built. The `Startup` class is typically specified by calling the [WebHostBuilderExtensions.UseStartup\<TStartup>](xref:Microsoft.AspNetCore.Hosting.WebHostBuilderExtensions.UseStartup*) method on the host builder:
0 commit comments