MudBlazor Modal

AussieBoy

Well-known member
Joined
Sep 7, 2020
Messages
78
Programming Experience
Beginner
Hi, I am going through tutorials and code to get a start with Blazor and MudBlazor.
This is the page I am looking at.
My project even when zipped is too large to upload.
Its not my code. It is just code I am trying to trial things out with.
Thanks,
(not sure if there is a blazor section to this forum)
There is an error with "DialogUsageExample_Dialog".

C#:
@inject IDialogService DialogService


<MudButton @onclick="OpenDialog" Variant="Variant.Filled" Color="Color.Primary">
    Open Simple Dialog
</MudButton>
@code {
    private void OpenDialog() => DialogService.Show<DialogUsageExample_Dialog>("Simple Dialog");
}
 
Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'DialogUsageExample_Dialog' could not be found (are you missing a using directive or an assembly reference?) MudBlazor.Client C:\Users\d_ski\source\repos\BlazorComponents-main\MudBlazor\Client\Pages\Index.razor 8 Active

Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'DialogUsageExample_Dialog' could not be found (are you missing a using directive or an assembly reference?) MudBlazor.Client C:\Users\d_ski\source\repos\BlazorComponents-main\MudBlazor\Client\Pages\Index.razor 8 Active
 
DialogUsageExample_Dialog is supposed to be a class that you supply.

The link that you provided above says this:
Suppose you define a MudDialog in TermsOfServiceDialog.razor. To show the dialog you simply call:
DialogService.Show<TermsOfServiceDialog>("Terms");

If you dig deeper into the repo, you'll find this file:
 
Hi, I had tried DialogService.Show<TermsOfServiceDialog>("Terms"); with no luck.

I have downloaded the contents from GitHub with and I can't get that working either.

Severity Code Description Project File Line Suppression State
Error MSB3073 The command "dotnet tool restore" exited with code 1. MudBlazor C:\Users\d_ski\source\repos\MudBlazor-dev\src\MudBlazor\MudBlazor.csproj 61
 
Do you have a "TermsOfService.razor" file in your project? If not, why would you expect it to work.

Right now it feels like you are just copying and pasting code hoping to get something to work without standing back and taking time to understand what the library that you are trying to use does.
 
Yay!
 
Back
Top Bottom