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
Aalhussein
1.6k
133
10.1k
Server control - drop down list :using the right property?
Apr 7 2020 2:47 AM
Greetings,
I created a couple of dropdown list. then called a method to retrun a datareader that contains data from the database. I need to populate a form . So my code below suppose to do so, but when using selectedIndex, it works, but when using .SelectedItem.Value does not work.
Any idea why?
Note when populateing inputform from gv via link. Only use selected index to work. Selecting the other will not give the value to the input form. ?
2nd Question, how do I know when to use any of the properties below. Can I stick to only one for instance
.SelectedValue and ignore the rest.
ddlqualification.SelectedItem.Value = dr["qualificationid"].ToString() ;
ddlqualification.SelectedIndex = dr["qualificationid"].ToString() ;
ddlqualification.SelectedValue= dr["qualificationid"].ToString() ;
Please advise,
Thanks
Al
Reply
Answers (
2
)
How to save the data in client side in grid with image
How to validate error message on web form?