Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

Help with Dropdownlist Can't add List Items

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jack - 21 Jun 2007 19:57 GMT
Hello,

I have a dropdownlist in my aspx page:

<asp:DropDownList ID="DDLProjects" runat="server"><asp:ListItem Text
="TEST9" Value ="TEST9"/></asp:DropDownList>

Then in my Page_Load I have:

 Dim newListItem1 As New System.Web.UI.WebControls.ListItem()
 newListItem1.Text = "TEST2"
 newListItem1.Value = "TEST2"
 DDLProjects.Items.Add(newListItem1)
 DDLProjects.Items.Add(New ListItem("Item 1", "1"))

 DDLProjects.Items.Add(New ListItem("T1", "T2"))

The Only thing I can get in the drop down is the TEST9 witch is done the the
ASPX page and not in the Code.

Any Help would be great!!!

Thanks,

Jack
Eliyahu Goldin - 21 Jun 2007 21:51 GMT
The code looks fine. There must be an error somewhere else. Set a breakpoint
on this code and debug it.

Signature

Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin

> Hello,
>
[quoted text clipped - 21 lines]
>
> Jack

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.