Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How to Pass Data from ASP.NET Core MVC View to a Blazor Component?

$
0
0

I'm working on an ASP.NET Core MVC project that integrates with Blazor. I have a Blazor component, and I want to pass data from my MVC view to this component. Below is a simplified version of what I have:

MVC View:

@{    ViewData["Title"] = "Home Page";    var data = "testData";}<component type="typeof(mvcTestBlazor.Components.Counter)" render-mode="Server" Data="data" />Blazor Component:    @code {    [Parameter]    public string Data { get; set; }}

Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>