ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Blazor Routing in depth

blazor routing

routing

blazor route

component routing

component route

iurihelper

aspnetcore blazor

Aspnetcore blazor

blazor

asp.net blazor

blazor aspnetcore

c# in browser

dotnet in browser

blazor tutorials

blazor vs javascript

javascript vs webassembly

webassembly and blazor

blazor and webassembly

webassembly and .net

blazor example

babu tech programmer

blazor runtime

webassembly in GO

di in blazor

Автор: Babu Tech Programmer

Загружено: 2018-05-17

Просмотров: 1082

Описание: What is Blazor routing?
Routing in blazor is the way by which a user request is responded by blazor component based on the url request. Like other routing framework in blazor you have to define the route and then we can use the route. In blazor component is the building block. So here we have to declare the routing in the component. This routing is then can be used to discover the component or to redicrect to the route.
Rout can be define in two ways,
suppose your creating the component as .cshtml then we can use the @page “rout” it is similar to routing in razor pages.
If your creating the component using .cs files means coding, then we have to declare the rout as RoutAttribute.
Once the route is defined we have to trigger routing framework. That part id done partially in the App.cshtml it temporary, in future the experience of doing this will be more seamless, may be like in Mvc, in blazor .UseBlazorRout().

Passing parameter in rout url and getting the value
route parameter is declare like @page “/{routparameter}” and we have to declare a property of type string to get the parameter value.
Note: there is no concept of optional parameter concept in current release of Blazor. If you want to achieve the optional parameter functionality then we have to declare two routes one with parameter other with non parameter.

Routing programmatically:-
this is another common scenario in web which allows us to programmatically redirect to other component.
Suppose take our todo application example. In here when the user clicks the the create button if the insert of data is success then we just want to redirect the user to the todo list page. To do this we have to take the help of dependency injection and inject IurilHelper interface.
@inject Microsoft.Aspnetcore.Blaazor.services.IuriHelper uriHelper.

Then in the code we can call uriHelper.Navigateto(“uri”);

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Blazor Routing in depth

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]