Mudtextfield在每次击键中发送HTTP请求
我将MudTextField用于登录表单。每当用户在文本字段中键入某些内容时,应用程序将当前状态发送到服务器。
示例:
<MudTextField Label="Username" Class="mt-3" @bind-Value="user.username" />
仅当用户klicks在登录按钮上时,它才应发送状态。
关于如何禁用它的任何想法?
谢谢。
编辑:添加了更多信息以进行澄清。
当使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论