验证控件插图扩展控件ValidatorCalloutExtender(用于扩展验证控件)和TextBoxWatermarkExtender

时间:2023-03-08 22:08:51
验证控件插图扩展控件ValidatorCalloutExtender(用于扩展验证控件)和TextBoxWatermarkExtender

<asp:ScriptManager ID="ScriptManager1" runat="server">
 </asp:ScriptManager>

­­­­­    请输入歌曲名称:<asp:TextBox ID="txtSongName" runat="server"></asp:TextBox>

        <asp:Button ID="btnSelect" runat="server" Text="搜索"/>

         <!--TextBoxWatermarkExtender 控件(文本框填写说明提示)-->
            <cc1:TextBoxWatermarkExtender ID="TextBoxWatermarkExtender1" TargetControlID="txtSongName" WatermarkText="请输入歌曲名称" runat="server">
            </cc1:TextBoxWatermarkExtender>

         <!--RequiredFieldValidator 控件(为空验证)-->
            <asp:RequiredFieldValidator ID="valiNull" Display="None"  ControlToValidate="txtSongName" runat="server" ErrorMessage="歌曲名称不能为空">

          </asp:RequiredFieldValidator>

         <!--ValidatorCalloutExtender(该控件用于扩展验证控件)-->
             <cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" TargetControlID="valiNull"></cc1:ValidatorCalloutExtender>

验证控件插图扩展控件ValidatorCalloutExtender(用于扩展验证控件)和TextBoxWatermarkExtender