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
Alex P
NA
16
898
Disable a default value from dropdownlist
Jul 29 2018 2:23 PM
Hi, I have a code where it takes and saves input as
XYZ
if no value is selected from a drop down list. I want to disable it, so that the system is not allowed to save any empty value.
As a trial & error method I just
uncommented
a piece of code.
//
var defaultSelectItem = new SelectListItem() { Text = "-SELECT ONE-", Value = "XYZ", Selected = String.IsNullOrEmpty(jurisCode) };
//
jurisForDisplay.Insert(0, defaultSelectItem);
Result:
It doesn't give me a option to leave blank.
Partial problem:
System itself gives a state name as a default input in alphabetic order. So, the user should be cautious to edit the state name. Which is tough in my case as end users are truck drivers.
Is there something else I can do which allows user to select input by himself and should also not allow a blank valur to be saved.
Reply
Answers (
3
)
login with google account chrome custom tab
Why does the DataTable get strings do not exceed 255 charact