gpt4 book ai didi

asp.net - 如何在 RegularExpressionValidator ErrorMessage 字段中插入换行符?

转载 作者:行者123 更新时间:2023-12-01 12:22:24 27 4
gpt4 key购买 nike

考虑下面这段代码:

<asp:RegularExpressionValidator 
ID="MyTestId"
ValidationGroup="MyTestGroup"
ErrorMessage="You are a silly user. You entered the wrong format for this problem. Please try again. Using this format! ELRLDKX##Z"
ValidationExpression="some unrelated regex"
runat="server"
ControlToValidate="MyTestTextbox">
</asp:RegularExpressionValidator>

有没有办法在 ErrorMessage 字符串中插入某种转义字符,以确保请重试。使用这种格式! ELRLDKX##Z 在另一条线上?我试过了,\n 运气不好。

最佳答案

Validator 在网页上,因此您只需将 html 代码添加到文本中,如 <br />

ErrorMessage="You are a silly user. You entered the wrong format for this problem.<br />Please try again. Using this format! ELRLDKX##Z"

关于asp.net - 如何在 RegularExpressionValidator ErrorMessage 字段中插入换行符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43095537/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com