Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
6
Reply
Dropdownlist Validation with RequiredFieldValidator
Vd Tripathi
Aug 17 2016 3:35 AM
307
Reply
I have one Dropdownlist to be validated by RequiredFieldValidator. And It has OnSelectedIndexChanged event so I have set AutoPostBack=true.(That is required because this dropdownlist will fill another dropdownlist on selection index changed).
I have set InitialValue="-1" that is first item as "--Select--". As I click on submit button it reload the page and then it shows error message.
This is my controls....
<asp:DropDownList ID="ddlMsgSubCategories" runat="server" Width="320px" AutoPostBack="True" CausesValidation="True" OnSelectedIndexChanged="ddlMsgSubCategories_SelectedIndexChanged" CssClass="fontStandardInput"></asp:DropDownList><br />
<asp:RequiredFieldValidator runat="server" ID="rfvMsgSubCategories" ControlToValidate="ddlMsgSubCategories" Display="Dynamic" CssClass="fontValidation" InitialValue="-1" SetFocusOnError="true"></asp:RequiredFieldValidator>
Is there any option that can be used to validate dropdownlist without reloading page.
Thanks.
Vishwakant.
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
6
)
Next Recommended Forum
which is better mcpd or mcse........?? pls anyone tell
How to calculate summery of table cloumn and bind to textbo