Mudtextfield在每次击键中发送HTTP请求

发布于 2025-01-30 19:57:35 字数 925 浏览 2 评论 0原文

我将MudTextField用于登录表单。每当用户在文本字段中键入某些内容时,应用程序将当前状态发送到服务器。

示例:

<MudTextField Label="Username" Class="mt-3" @bind-Value="user.username" />

仅当用户klicks在登录按钮上时,它才应发送状态。

关于如何禁用它的任何想法?

谢谢。

编辑:添加了更多信息以进行澄清。

与PIC相关的是网络面板的输出,并启用了长启动作为运输机制

当使用MudTextField组件时发生。使用具有HTML输入字段的自定义组件和Vanilla Razor Tway绑定将不会显示相同的行为。

例如:

<div class="form-floating mb-1">
    <input type="text" class="form-control" id="username" @bind="@user.username" placeholder="[email protected]">
    <label for="username">Username</label>
</div>

在浏览Mudblazor网站以获取信息之后,似乎属性是正确的选择,但我无法使其正常工作。

I use MudTextField for a login form. Whenever a user types something into the text field the application sends the current state to the server.

Example:

<MudTextField Label="Username" Class="mt-3" @bind-Value="user.username" />

It should only send the state when a user klicks on the login button.

Any ideas on how to disable it?

Thank you.

EDIT: Added more information for clarification.

Pic related is the output from the network panel with long-polling enabled as a transport mechanism

This only happens when using a MudTextField component. Using a custom component with a HTML input field and vanilla razor two-way binding will not display the same behavior.

E.g:

<div class="form-floating mb-1">
    <input type="text" class="form-control" id="username" @bind="@user.username" placeholder="[email protected]">
    <label for="username">Username</label>
</div>

After browsing the MudBlazor website for information it seems that the Immidiate attribute would be the right option for it but I can't make it work.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文