asp.net - Require field validator disappear because of auto post of drop down -


here issue require filed validator , here use 1 drop down box select time associated require field validator in drop down there 1-24 hour time , select time first index. in page in drop down time selection necessary if user select time again goes initial value of first index or select time option time require field validator work , disappear because of partial post or auto post of drop down.i have use update panel. want whenever user not select time or choos select time option time require field validator prompt user select time. until user not select time cant process further.

<div class="loginbox">                 <asp:label id="lbldatetime" text="date & time:" cssclass="jobtitle"   associatedcontrolid="txtdate"                     runat="server"></asp:label>                                     <asp:dropdownlist id="ddltime"  runat="server" autopostback="true"   onselectedindexchanged="ddltime_selectedindexchanged">                 </asp:dropdownlist>                 <asp:requiredfieldvalidator id="rfvtime" runat="server" display="dynamic" controltovalidate="ddltime"                     text="select time" errormessage="select time" initialvalue="-1" cssclass="errmsg"></asp:requiredfieldvalidator>             </div> 


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -