Home > DeveloperSection > Forums > DropDown List Validation
Ankita Pandey
Ankita Pandey

Total Post:183

Points:1285
Posted on    August-23-2014 7:37 AM

 ASP.Net ASP.Net 
Ratings:


 1 Reply(s)
 588  View(s)
Rate this:

I need to perform a validation to check whether a TextBox value is empty on Dropown list selected Index change using validation controls in asp.net



Sumit Kesarwani

Total Post:378

Points:2694
Posted on    August-23-2014 8:47 AM

Hi Ankita, 

I hope this will work fine.

    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

    <asp:DropDownList ID="DropDownList1" runat="server" CausesValidation="true" AutoPostBack="true">

    </asp:DropDownList>

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="TextBox1" runat="server" ErrorMessage="Please Enter the Value"></asp:RequiredFieldValidator>


Don't want to miss updates? Please click the below button!

Follow MindStick