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
goce micevski
NA
19
0
DropDownList - Add attributes to items
Sep 22 2004 5:20 AM
Hello, The problem is this: I have a drop down list and i bound it from db with text and value, so every (list item)option will have value and text. I know how to add style attribute, but i have problem assigning id atribute to every listItem in this list. This is because i need additional info except from value field, ie i need to add info to every option from another datatable column. example: Name.DataSource = dsMobileProductNames; Name.DataTextField = "NAME"; Name.DataValueField = "UNIQUEID"; Name.DataBind(); so after this i wan to do something like this foreach(ListItem li in Name.Items) { li.Attributes.Add("id","here some value"); } so at the end in the html it would like this:
some text
Thanks in advance
Reply
Answers (
1
)
Problem with some hidden fields
ASP.NET with C#