'如何'将球组件链接到触点视图ASP.NET核心

发布于 2025-02-10 16:54:55 字数 761 浏览 4 评论 0 原文

我遵循了本在线教程,因为我想在联系表格中添加recaptcha,并决定尝试一下。

https://elliottbrand.com/blog/1/creating-a-contact-form-in-aspnet-core-31-mvc-using-google-recaptcha-and-blazor

我遵循所有指令而且我为正在开发的网站所做的大多数功能都可以在视图中显示 ContactComponent 。我在ASP.NET Core应用程序中使用默认导航。

<li class="nav-item">
    <a class="nav-link text-dark"  asp-area="" asp-controller="Controller" asp-action="Component">Contact</a>   
</li>

我的问题是联系视图不会在本地呈现 ContactComponent

我是否需要将联系人组件注入联系人视图,还是只是一个链接问题。

只是回到我的发展事业,所以我很抱歉听起来很愚蠢,因为我觉得这只是一个链接问题。非常感谢!

I followed this online tutorial as I wanted to add ReCaptcha to my contact form and decided to give this a go.

https://elliottbrand.com/blog/1/Creating-a-Contact-Form-in-AspNet-Core-31-MVC-Using-Google-reCAPTCHA-and-Blazor

I followed all the instructions and I have most of the functionality done for the website I am developing, however I am stuck getting the ContactComponent to show in the view. I am using the default navigation in an ASP.NET Core application.

<li class="nav-item">
    <a class="nav-link text-dark"  asp-area="" asp-controller="Controller" asp-action="Component">Contact</a>   
</li>

My problem is that the Contact View will not render the ContactComponent locally.

Do I need to inject the Contact Component into the contact View or is it just a linking issue.

Just getting back into my development career so I am sorry if sounds silly as I feel its just a link issue. Many thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柳若烟 2025-02-17 16:54:55

让ContactComponent在视图中显示

尝试使用组件标记助手在cshtml视图中渲染闪电组件。

 <component type="typeof(Counter)" render-mode="ServerPrerendered" />

阅读 prerender并集成了asp.net核心剃须刀组件以了解更多信息。

getting the ContactComponent to show in the view

Try to use the component tag helper to render Blazor components in cshtml views.

 <component type="typeof(Counter)" render-mode="ServerPrerendered" />

Read Prerender and integrate ASP.NET Core Razor components to know more.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文