I'm having a hard time figuring out what the syntax should be to open a dialog and place an error message in it from my C# code.
For example, if a SQL error occurs, how do I pop up a dialog with the error in it?
BTW... At the moment I am getting a " We're sorry, but something went wrong at https://blazor.radzen.com/get-started, so I don't have detailed example code for you. But basically, I was just trying to move the code as is to "code-behind".
If I try to implement the "ShowSimpleDialig" in "code-behind" it does't like the syntax no matter how I arrange it. It looks to me like it wants a dictionary and not the lamda that is being used in the example.
I finally got to the point were I can get a dialog to appear with:
|Error|CS0411|The type arguments for method 'DialogService.OpenAsync(string, Dictionary<string, object>, DialogOptions)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
If I add the type with .OpenAsync<RadzenCard> (guessing that RadzenCard is correct). I get
Error CS1660 Cannot convert lambda expression to type 'Dictionary<string, object>' because it is not a delegate type HxDm.Server
Cannot implicitly convert type 'string' to 'Microsoft.AspNetCore.Components.RenderFragment'|HxDm.Server|
Cannot convert lambda expression to intended delegate type because some of the return types in the block are not implicitly convertible to the delegate return type
The code I am receiving an error on is a direct copy to an inherited C# class. I will work with it further. Please let me know if you have any examples with it working in a C# class.