Hello,
how do we show it on the screen when we use it in index.razor page
You can use @properties
to get this Dictionary
in your blazor page, I show it on the screen by <p>
, here is my index.razor
page for testing.
@page "/"
<h1>Hello, world!</h1>
Welcome to your new app.
<SurveyPrompt Title="How is Blazor working for you?" />
<a>
@foreach (KeyValuePair <string, object> kvp in properties)
{
<p>@kvp.Key</p>
<p>@kvp.Value</p>
}
@properties.GetValueOrDefault("Hello");
</a>
@code{
Dictionary<string, object> properties;
protected override async Task OnInitializedAsync()
{
properties = new Dictionary<string, object>();
properties.Add("Hello", "Greetings");
}
}
As note: Ask one question at a time, you can open a new thread about localization.
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.