how to show only one message in validation summary at a time asp.net -
<div id="dverrormessagesprofile" style="padding-top:2px; margin: 0 auto; width:540px;"> <asp:validationsummary id="validationsummary2" clientidmode="static" runat="server" validationgroup="vgprofile" /> <asp:requiredfieldvalidator id="rfvfirstname" display="none" runat="server" errormessage="<div class='error_box_login'>please enter first name.<a href='javascript:void(0);' onclick='hidevalid(this);' class='error-cross'></a> </div>" controltovalidate="firstname" setfocusonerror="true" validationgroup="vgprofile"></asp:requiredfieldvalidator> <asp:requiredfieldvalidator id="rfvlastname" display="none" runat="server" errormessage="<div class='error_box_login'>please enter last name.<a href='javascript:void(0);' onclick='hidevalid(this);' class='error-cross'></a> </div>" controltovalidate="lastname" setfocusonerror="true" validationgroup="vgprofile"></asp:requiredfieldvalidator> <asp:requiredfieldvalidator id="rfvaddressline1" display="none" runat="server" errormessage="<div class='error_box_login'>please enter address line 1.<a href='javascript:void(0);' onclick='hidevalid(this);' class='error-cross'></a> </div>" controltovalidate="addressline1" setfocusonerror="true" validationgroup="vgprofile"></asp:requiredfieldvalidator> <asp:requiredfieldvalidator id="rfvcity" display="none" runat="server" errormessage="<div class='error_box_login'>please enter city.<a href='javascript:void(0);' onclick='hidevalid(this);' class='error-cross'></a> </div>" controltovalidate="city" setfocusonerror="true" validationgroup="vgprofile"></asp:requiredfieldvalidator> <asp:requiredfieldvalidator id="rfvzip" display="none" runat="server" errormessage="<div class='error_box_login'>please enter zip.<a href='javascript:void(0);' onclick='hidevalid(this);' class='error-cross'></a> </div>" controltovalidate="zip" setfocusonerror="true" validationgroup="vgprofile"></asp:requiredfieldvalidator>
i want show first message of validation summery. mean if user not enter value shows 1st message other not shown etc...
validationsummary it's name says - summary of validations. i'm not aware of pre-built attritube or let pick message want show.
you have few options
- create custom control
- use jquery/javascript/... validation , control there
- create label or , control shown message c# code
Comments
Post a Comment