Loading

切换RequiredFieldValidator和RegularExpressionValidator提示信息的控件

来源:PowerEasy
添加后直接引用就可以了
附上控件代码
InteractiveMessager

附上页面代码

<asp:TextBox ID="txtAnswer" runat="server" style="width:180px" ></asp:TextBox>
                     
<span style ="color :Red">*</span>
                     
<asp:RequiredFieldValidator 
                        ControlToValidate 
="txtAnswer" 
                        ID
="RequiredFieldValidator4" 
                        runat
="server" 
                        ErrorMessage
="(此项必填)"
                        Display
="None">
                    
</asp:RequiredFieldValidator>
                    
<asp:RegularExpressionValidator 
                            ControlToValidate
="txtAnswer"  
                            ID
="RegularExpressionValidator8" 
                            runat
="server" 
                            ErrorMessage
="您的答案少于四个字符或者多于五十个字符" 
                             ValidationExpression
="^.{4,50}$"
                             Display
="None">
                    
</asp:RegularExpressionValidator>
                    
</li>
                     
<uc:InteractiveMessager ID ="interactiveMessager5" 
                        ControlToMessage 
="txtAnswer" 
                        runat 
="server" 
                        Text
="用于取回密码。请尽量设得复杂一些,以防被人用找回密码功能窃取您的帐号。长度在四到五十个字符之间。"
                         ValidatorOkMessage 
="答案已经输入"  >
                     
</uc:InteractiveMessager>
posted @ 2009-09-01 15:37  today4king  阅读(988)  评论(0编辑  收藏  举报