No content is showing on dialog

Hi I am using Radzen.DialogService
I finished all the configurations as described in the documentation. Actually, My Dialog is showing. But it is showing without any content from its body. Not even a plain HTML Like <p>Test</p>
Following is my workflow:
From a button click from Page index.razor

 await DialogService.OpenAsync<RequestCreateEditCard>($"Add new vacation:", 
                new Dictionary<string, object>() { { "RequestId", 1 } },
               new DialogOptions() { Width = "700px", Height = "570px", Resizable = true, Draggable = true });

RequestCreateEditCard.razor

@page "/RequestCreateEditCard/{requestId}"


@inject Radzen.DialogService dialogService
@implements IDisposable
@inherits Index

<p>Test: Paragraph tag is showing</p>

<div class="row">   
    <div>      
            @if (vacationTypes != null)
            {
                Console.WriteLine("value is not null");
                foreach (var item in vacationTypes)
                {
                    <div> @item.Name</div>
                }
            }
            <h4 class="mb-4">Custom filter operator</h4>
            <RadzenDropDown AllowClear="true" TValue="string" Class="w-100"
                            FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" FilterOperator="StringFilterOperator.StartsWith" AllowFiltering="true"
                            Data=@vacationTypes TextProperty="Name" ValueProperty="Id" />
     
        @* Change=@(args => OnSelectionChange(args, "DropDown with custom filter operator"))*@

    </div>
</div>
<div class="row">
    <div class="col-md-12 text-right">
        <RadzenButton Click="@((args) => dialogService.Close(false))" ButtonStyle="ButtonStyle.Secondary" Text="Cancel" Style="width: 120px" Class="mr-1" />
        <RadzenButton Click="@((args) => dialogService.Close(true))" Text="OK" Style="width: 120px" />
    </div>
</div>


@code {

}

RequestCreateEditCard.razor.cs

using Microsoft.AspNetCore.Components;
using Radzen;
using ramomVMS.Client.Contracts;
using ramomVMS.Client.Models;
using ramomVMS.Client.Static;

namespace ramomVMS.Client.Pages.Dashboard
{
    public partial class RequestCreateEditCard
    {
    
        [Inject] IHttpRepository<VacationType> _vacationTypeClient { get; set; }
        [Inject] IHttpRepository<VacationRequest> _vacationRequest { get; set; }
        [Parameter] public int RequestId { get; set; }
        [Inject] NotificationService _notification { get; set; }

        private List<VacationType> vacationTypes;

        public VacationRequest VacReq { get; private set; }

        protected override void OnInitialized()
        {
            _notification.Notify(new NotificationMessage
            {
                Severity = NotificationSeverity.Info,
                Summary = "Dialog service reached",
                Detail = RequestId.ToString(),
                Duration = 4000
            });
        }
        public async override Task SetParametersAsync(ParameterView parameters)
        {
            if (parameters.TryGetValue<int>(nameof(RequestId), out var value))
            {
                _notification.Notify(new NotificationMessage
                {
                    Severity = NotificationSeverity.Error,
                    Summary = "Test value passed",
                    Detail = value.ToString(),
                    Duration = 4000
                });

                vacationTypes = await _vacationTypeClient.GetAll(Endpoints.VacationEndpoint + "/type");
                VacReq = await _vacationRequest.Get(Endpoints.VacationEndpoint + "/request", value);
            }

        }

        public void Dispose() { }

    }
}


Both the notification for OnInitialized() and SetParametersAsync(ParameterView parameters)
is showing that means my dialog service is reached from the Index.razor page. The dialog is also opening But without any content.
Any help will be highly appreciable

Does it work if you remove @inherits Index? This should be needed and could make your page to not render anything.

@Mahfuzur_Rahman

Very wild guess: right click on RequestCreateEditCard.razor and select "Properties".

image

Build Action should be "Content". If you see something different, probably "None", change it, rebuild and try. Inspect your Index.razor this way as well.

1 Like