Blazor asp.net 核心托管应用未向其 razor 组件注册部分 class
Blazor asp.net core hosted app doesnt register partial class to its razor component
我试图将我的客户端仅 WASM 转换为 asp.net 核心托管,但是,我的 component.razor 不再注册它是 component.razor.cs 部分 class .
Auth.razor
<Warning Display="@_display" Message="@WarningMessage"/>
@{
if (Properties == null)
{
<p><em>Loading...</em></p>
}
else
{
foreach (var prop in Properties)
{
<InputBox @bind-InputValue="prop.Value" Name="@prop.Name" IsPassword="@prop.IsPassword"/>
}
}
}
<button type="submit" @onclick="@SubmitButton_Click">Submit</button>
</div>
Auth.razor.cs
namespace Project.Pages
}
public partial class Auth
{
private IEnumerable<InputField> Properties { get; set; }
.
.
.
}
}
当我在 Rider 中打开项目时,它甚至会堆叠。
如果您需要任何想法或向我解释这与创建基础之间的区别 class
命名空间应该是 Project.Client.Pages
,因为服务器部分也包含页面。
我试图将我的客户端仅 WASM 转换为 asp.net 核心托管,但是,我的 component.razor 不再注册它是 component.razor.cs 部分 class .
Auth.razor
<Warning Display="@_display" Message="@WarningMessage"/>
@{
if (Properties == null)
{
<p><em>Loading...</em></p>
}
else
{
foreach (var prop in Properties)
{
<InputBox @bind-InputValue="prop.Value" Name="@prop.Name" IsPassword="@prop.IsPassword"/>
}
}
}
<button type="submit" @onclick="@SubmitButton_Click">Submit</button>
</div>
Auth.razor.cs
namespace Project.Pages
}
public partial class Auth
{
private IEnumerable<InputField> Properties { get; set; }
.
.
.
}
}
当我在 Rider 中打开项目时,它甚至会堆叠。 如果您需要任何想法或向我解释这与创建基础之间的区别 class
命名空间应该是 Project.Client.Pages
,因为服务器部分也包含页面。