TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vishwakant Tripathi
1k
721
839.7k
Dropdownlist Validation with RequiredFieldValidator
Aug 17 2016 3:35 AM
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.
Reply
Answers (
6
)
How to write custom sql query using entity framework
How to calculate summery of table cloumn and bind to textbo