updating emule server - Asp net validating drop down lists
View: You could name Options and Selected Option ID a bit better to clarify their usage depending on your implementation.
With this implementation you would (and should) populate the options list from your controller.
For Adding the salary (Create operation), i have to select the month type from the Drop Down List, if the month is not selected the program should not have to redirect to create action.
How Can i validate the Drop Down, Before Routing to Create Action ?
Side note: You claim your using a view model, but in fact your not. A view model contains only properties relevant to your view and should never contain method that access your database.
I am working on certain task and i put dropdownlist from modelview and i put validation on it ,like user must select at least subject ,but its not working ,let me share code snippet related to problem ,here is model view using System; using System.
Basically you want a validator that is disabled until Txt Close Date contains text.
The validator must evaluate a Drop Down List with its selected item="Pending". Visible = False End If End Sub THEN in the textbox Change event call...I am new to MVC and I am still trying to explore stuffs inside MVC.Now I came to place where I need to implement validation for drop-down list.I spent fair amount of time searching for validation in MVC.But I dint get any result which suits to my problem.The selected option would be populated when the user selects an option.