c# - Blazor asp.net 核心托管应用程序未将部分类注册到其 razor 组件
问题描述
我试图将我的客户端仅 WASM 转换为托管的 asp.net 核心,但是,我的 component.razor 不再注册它的 component.razor.cs 部分类。
授权剃须刀
<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>
授权剃须刀.cs
namespace Project.Pages
}
public partial class Auth
{
private IEnumerable<InputField> Properties { get; set; }
.
.
.
}
}
当我在 Rider 中打开项目时,它甚至会堆叠。如果您需要任何想法或向我解释这与创建基类之间的区别
解决方案
命名空间应该是Project.Client.Pages
因为服务器部分也包含页面。
推荐阅读
- vuejs2 - “过滤器不是函数”计算属性上的类型错误,带有箭头函数的简单过滤器
- javascript - 当我尝试从数组中渲染对象时出现类型错误
- angular - Angular 2子路由组件加载问题
- python - Discord.py 在命令后监听消息
- python - 随机改组 2 个尽可能高效同步的 numpy 数组
- javascript - jQuery 数组值进入选择选项值?
- vb.net - 如何将对象与 ToolStripMenuItem VB.net 关联?
- node.js - 通过 ElasticBeansStalk 上托管的 API Gateway 在 AWS S3 上上传图像
- java - Hibernate:返回不是实体的 DTO?
- python - 为什么我得到颠倒的图像?