Skip to content

Commit e6ab1f0

Browse files
authored
Merge pull request #9235 from syncfusion-content/1025699-mig
1025699: Migration guide updation
2 parents ed0ac82 + 196de9f commit e6ab1f0

2 files changed

Lines changed: 22 additions & 28 deletions

File tree

blazor/common/migration/core-mvc-to-blazor.md

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Migrating enterprise applications from [ASP.NET Core MVC](https://learn.microsof
1313

1414
## Why migrate from ASP.NET Core MVC to Blazor?
1515

16-
ASP.NET Core MVC applications follow a request response model, where user requests are handled by controllers and rendered using views. UI updates often require full page reloads or additional techniques such as partial views or AJAX, which can increase complexity as applications become more interactive.
16+
[ASP.NET Core MVC](https://learn.microsoft.com/en-us/aspnet/core/mvc/overview) applications follow a request response model, where user requests are handled by controllers and rendered using views. UI updates often require full page reloads or additional techniques such as partial views or AJAX, which can increase complexity as applications become more interactive.
1717

18-
Blazor introduces a component based, event driven UI model, where user interactions trigger updates directly within components rather than full page reloads. It enables reusable UI components and aligns closely with modern .NET development practices.
18+
[Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/) introduces a component based, event driven UI model, where user interactions trigger updates directly within components rather than full page reloads. It enables reusable UI components and aligns closely with modern .NET development practices.
1919

2020
| Aspect | ASP.NET Core MVC | Blazor |
2121
| --- | --- | --- |
@@ -36,9 +36,9 @@ Blazor introduces a component based, event driven UI model, where user interacti
3636
* [.NET 8 SDK or later](https://dotnet.microsoft.com/en-us/download/dotnet)
3737
* [Visual Studio](https://visualstudio.microsoft.com/downloads/) 2022 or later, or [Visual Studio Code](https://code.visualstudio.com/) with [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit) extension
3838

39-
### Project structure comparison
39+
## Project structure comparison
4040

41-
The following table maps common ASP.NET Core MVC application artifacts to their Blazor equivalents, highlighting how application structure transitions from a request driven model to a component based architecture.
41+
The following table maps common [ASP.NET Core MVC](https://learn.microsoft.com/en-us/aspnet/core/mvc/overview) application artifacts to their [Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/) equivalents, highlighting how application structure transitions from a request driven model to a component based architecture.
4242

4343
| Concept | ASP.NET Core MVC artifact | Blazor equivalent |
4444
| -----| ------ | ----- |
@@ -54,7 +54,7 @@ The following table maps common ASP.NET Core MVC application artifacts to their
5454

5555
## Migrating Components from ASP.NET Core MVC to Blazor
5656

57-
Create a Blazor project using one of the following getting started guides.
57+
Create a [Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/) project using one of the following getting started guides.
5858

5959
* [Getting Started with Blazor Web App](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app)
6060
* [Getting Started with Blazor Server App](https://blazor.syncfusion.com/documentation/getting-started/blazor-server-side-visual-studio)
@@ -64,17 +64,17 @@ The following shared setup applies to all components and covers the common confi
6464

6565
### Package installation
6666

67-
In ASP.NET Core MVC, controls are typically installed using a single combined package, such as [Syncfusion.EJ2.AspNet.Core](https://www.nuget.org/packages/Syncfusion.EJ2.AspNet.Core).
67+
In [ASP.NET Core MVC](https://learn.microsoft.com/en-us/aspnet/core/mvc/overview), controls are typically installed using a single combined package, such as [Syncfusion.EJ2.AspNet.Core](https://www.nuget.org/packages/Syncfusion.EJ2.AspNet.Core).
6868

69-
In Blazor applications, using individual component packages improves performance and reduces application size. For the complete list of available packages, refer to the [Blazor NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages).
69+
In [Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/) applications, using individual component packages improves performance and reduces application size. For the complete list of available packages, refer to the [Blazor NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages).
7070

7171
Additionally, install the [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes) NuGet package for styling support.
7272

7373
### Service registration
7474

75-
In ASP.NET Core MVC, UI components are rendered as part of the view, and additional scripts and styles are included manually. There is no dependency injection (DI) based registration model specifically for UI components.
75+
In [ASP.NET Core MVC](https://learn.microsoft.com/en-us/aspnet/core/mvc/overview), UI components are rendered as part of the view, and additional scripts and styles are included manually. There is no dependency injection (DI) based registration model specifically for UI components.
7676

77-
In Blazor, components rely on the built-in dependency injection (DI) system. UI libraries like Syncfusion must be registered in the service container so that required services (such as rendering, localization, and JavaScript interop) are available to components.
77+
In [Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/), components rely on the built-in dependency injection (DI) system. UI libraries like Syncfusion must be registered in the service container so that required services (such as rendering, localization, and [JavaScript interop](https://learn.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/?view=aspnetcore-10.0)) are available to components.
7878

7979
In the `Program.cs` file, add the Blazor namespace and register services.
8080

@@ -97,8 +97,6 @@ var app = builder.Build();
9797

9898
Namespaces are imported into Razor views using `~/_ViewImports.cshtml`, primarily to enable Tag Helpers and HTML helper extensions.
9999

100-
Add the required namespace in `~/_ViewImports.cshtml`.
101-
102100
{% tabs %}
103101
{% highlight cshtml tabtitle="~/_ViewImports.cshtml" %}
104102

@@ -112,7 +110,7 @@ Add the required namespace in `~/_ViewImports.cshtml`.
112110

113111
**Blazor equivalent**
114112

115-
In Blazor, `~/_Imports.razor` serves a similar purpose but applies to Razor components. It allows components to access namespaces globally without requiring repeated `@using` statements in each `.razor` file.
113+
In [Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/), `~/_Imports.razor` serves a similar purpose but applies to Razor components. It allows components to access namespaces globally without requiring repeated `@using` statements in each `.razor` file.
116114

117115
Import the required namespaces in the `~/_Imports.razor` file.
118116

@@ -217,7 +215,7 @@ For additional details, refer to the [Blazor DataGrid getting started guide](htt
217215
The [ASP.NET Core MVC DataGrid](https://www.syncfusion.com/aspnet-mvc-ui-controls/grid) is defined using HTML Helper APIs, where [Columns](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.Grids.Grid.html#Syncfusion_EJ2_Grids_Grid_Columns) are configured through properties during component initialization.
218216

219217
{% tabs %}
220-
{% highlight cshtml %}
218+
{% highlight cshtml tabtitle="Index.cshtml" %}
221219

222220
@(Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)Model).Columns(col =>
223221
{
@@ -302,7 +300,6 @@ The [Blazor DataGrid](https://www.syncfusion.com/blazor-components/blazor-datagr
302300

303301
@page "/grid"
304302
@using Syncfusion.Blazor.Grids
305-
@rendermode InteractiveServer
306303

307304
<SfGrid DataSource="@orderData" TValue="OrdersDetails">
308305
<GridColumns>
@@ -443,7 +440,6 @@ The [Blazor Scheduler](https://www.syncfusion.com/blazor-components/blazor-sched
443440
@page "/schedule"
444441

445442
@using Syncfusion.Blazor.Schedule
446-
@rendermode InteractiveServer
447443

448444
<SfSchedule TValue="Meeting" Height="650px" CurrentView="View.Week">
449445
<ScheduleViews>
@@ -505,7 +501,7 @@ For detailed explanation, refer to the [Blazor Rich Text Editor getting started
505501
The [ASP.NET Core MVC Rich Text Editor](https://www.syncfusion.com/aspnet-mvc-ui-controls/wysiwyg-rich-text-editor) is initialized with configurable [ToolbarSettings](https://help.syncfusion.com/cr/aspnetmvc-js2/Syncfusion.EJ2.RichTextEditor.RichTextEditor.html#Syncfusion_EJ2_RichTextEditor_RichTextEditor_ToolbarSettings) and supports content formatting through predefined tools and customization options.
506502

507503
{% tabs %}
508-
{% highlight cshtml %}
504+
{% highlight cshtml tabtitle="Index.cshtml" %}
509505

510506
@using Syncfusion.EJ2
511507

@@ -538,7 +534,6 @@ The [Blazor Rich Text Editor](https://www.syncfusion.com/blazor-components/blazo
538534

539535
@page "/rte"
540536
@using Syncfusion.Blazor.RichTextEditor
541-
@rendermode InteractiveServer
542537

543538
<SfRichTextEditor @bind-Value="Content" Height="400px"></SfRichTextEditor>
544539

blazor/common/migration/core-razor-pages-to-blazor.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Migrating applications from [ASP.NET Core Razor Pages](https://learn.microsoft.c
1313

1414
## Why migrate from ASP.NET Core Razor Pages to Blazor?
1515

16-
ASP.NET Core Razor Pages simplify the MVC pattern by combining UI and logic at the page level. However, for highly interactive applications, developers often rely on JavaScript, partial rendering, and additional client-side logic to manage dynamic UI behavior.
16+
[ASP.NET Core Razor Pages](https://learn.microsoft.com/en-us/aspnet/core/razor-pages/) simplify the MVC pattern by combining UI and logic at the page level. However, for highly interactive applications, developers often rely on JavaScript, partial rendering, and additional client-side logic to manage dynamic UI behavior.
1717

18-
Blazor provides a modern approach by enabling component based UI development in C#, along with built-in state management and event driven updates. This reduces dependency on external JavaScript frameworks and improves maintainability, scalability, and developer productivity.
18+
[Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/) provides a modern approach by enabling component based UI development in C#, along with built-in state management and event driven updates. This reduces dependency on external JavaScript frameworks and improves maintainability, scalability, and developer productivity.
1919

2020
| Aspect | Razor Pages | Blazor |
2121
| --- | ---| --- |
@@ -30,8 +30,7 @@ Blazor provides a modern approach by enabling component based UI development in
3030
| Navigation model | File based routing (`Pages/*.cshtml`) | SPA style routing using `@page` |
3131
| Rendering model | Server rendered HTML with optional JS | Interactive rendering using server or client execution |
3232
| Component reuse | Limited (partials, tag helpers) | Strong component reusability |
33-
| JavaScript dependency | Often required for interactivity | Minimal (optional via JS interop) |
34-
| Testing & maintainability | Moderate | Improved due to component isolation |
33+
| JavaScript dependency | Often required for interactivity | Minimal (optional via [JS interop](https://learn.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/?view=aspnetcore-10.0)) |
3534
| Scalability | Depends on server rendering | Depends on hosting model |
3635

3736
## Prerequisites for Blazor
@@ -41,7 +40,7 @@ Blazor provides a modern approach by enabling component based UI development in
4140

4241
## Project structure comparison
4342

44-
ASP.NET Core Razor Pages and Blazor Web Apps follow different architectural patterns. The following table shows the functional equivalents between Razor Pages artifacts and Blazor, along with their roles in a Blazor Web App.
43+
[ASP.NET Core Razor Pages](https://learn.microsoft.com/en-us/aspnet/core/razor-pages/) and [Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/) Web Apps follow different architectural patterns. The following table shows the functional equivalents between Razor Pages artifacts and Blazor, along with their roles in a Blazor Web App.
4544

4645
| Razor Pages Artifact | Blazor Web App Equivalent | Description |
4746
| --- | --- | --- |
@@ -60,7 +59,7 @@ N> Business logic, POCO models, and stateless services from Razor Pages can typi
6059

6160
## Migrating components from ASP.NET Core Razor Pages to Blazor
6261

63-
Create a Blazor project using one of the following getting started guides.
62+
Create a [Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/) project using one of the following getting started guides.
6463

6564
* [Getting Started with Blazor Web App](https://blazor.syncfusion.com/documentation/getting-started/blazor-web-app)
6665
* [Getting Started with Blazor Server App](https://blazor.syncfusion.com/documentation/getting-started/blazor-server-side-visual-studio)
@@ -70,17 +69,17 @@ The following shared setup applies to all components and covers the common confi
7069

7170
### Package installation
7271

73-
In ASP.NET Core Razor Pages, controls are typically installed using a single combined package, such as [Syncfusion.EJ2.AspNet.Core](https://www.nuget.org/packages/Syncfusion.EJ2.AspNet.Core).
72+
In [ASP.NET Core Razor Pages](https://learn.microsoft.com/en-us/aspnet/core/razor-pages/), controls are typically installed using a single combined package, such as [Syncfusion.EJ2.AspNet.Core](https://www.nuget.org/packages/Syncfusion.EJ2.AspNet.Core).
7473

75-
In Blazor applications, using individual component packages improves performance and reduces application size. For the complete list of available packages, refer to the [Blazor NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages).
74+
In [Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/) applications, using individual component packages improves performance and reduces application size. For the complete list of available packages, refer to the [Blazor NuGet packages](https://blazor.syncfusion.com/documentation/nuget-packages).
7675

7776
Additionally, install the [Syncfusion.Blazor.Themes](https://www.nuget.org/packages/Syncfusion.Blazor.Themes) NuGet package for styling support.
7877

7978
### Service registration
8079

81-
In ASP.NET Core Razor Pages, controls are configured through script and stylesheet references in the layout, rather than through DI service registration.
80+
In [ASP.NET Core Razor Pages](https://learn.microsoft.com/en-us/aspnet/core/razor-pages/), controls are configured through script and stylesheet references in the layout, rather than through DI service registration.
8281

83-
Blazor, on the other hand, uses dependency injection by default. Components must be registered in the service container so the framework can provide the required functionality, such as rendering and JavaScript interaction.
82+
[Blazor](https://learn.microsoft.com/en-us/aspnet/core/blazor/), on the other hand, uses dependency injection by default. Components must be registered in the service container so the framework can provide the required functionality, such as rendering and JavaScript interaction.
8483

8584
In the `Program.cs` file, add the Blazor namespace and register the required services.
8685

@@ -136,7 +135,7 @@ The above lists the namespaces for all components covered in this guide. Import
136135

137136
**ASP.NET Core Razor Pages approach**
138137

139-
Scripts and styles are manually referenced in the shared layout (`_Layout.cshtml`). In addition controls require the `<ejs-scripts>` helper, which initializes the required JavaScript components at runtime.
138+
Scripts and styles are manually referenced in the shared layout (`_Layout.cshtml`). In addition controls require the `<ejs-scripts>` helper, which initializes the required JavaScript controls at runtime.
140139

141140
{% tabs %}
142141
{% highlight html tabtitle="_Layout.cshtml" %}

0 commit comments

Comments
 (0)