Tuesday, June 15, 2021

【BLAZOR】Add Dynamic Content

 @page "/dynamic" 

<h3>dynamicComponent</h3>

<br />

<br />


<button @onclick="HandleBlazorServerClick">Blazor Server</button>

<button @onclick="HandleBlazorWebAssemblyClick">Blazor WebAssembly</button>


<div>

    @title

</div>

<div>

    @content

</div>


@code {

    private string title;

    private string content;


    private void HandleBlazorServerClick() { 

        title = "Blazor Server";

        content = "Blazor Server generate dynamic...";

        }

    

    private void HandleBlazorWebAssemblyClick() { 

        title = "Blazor WebAssembly";

        content = "Blazor webassembly runs completely within the web";

        }


}


No comments:

Post a Comment