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
joe_coolish
NA
5
0
Dropdown Box troubles
May 26 2005 12:50 PM
ok, here's what i've got. I have this internal phonedirectory page that i'm developing, and one of the options (to select the office) is done with a dropdown box, and when an office is selected that has sub offices, a second dropdown box's visibility is set to true so that you can select from that DDB to. Now, i'm querying all the data for the second dropdown box from a SQL database (i'm probably going to convert the first drop down to be pulled from a db soon) but the problem comes when i do a submit on the form. All the data stays, but the second ddb resets the select to the defualt (top) item. The second drop down box initially has no items and the script that adds data to the box is as follows . . . if(OfficeInput.SelectedValue.Equals("") { . . . } else { . . OfficeInputSecond.Items.Clear(); phoneConn.Open(); SqlDataReader read = phoneComm.ExecuteReader(); while(read.Read()) { if(read[0].ToString().Equals(OfficeInput.SelectedValue)) { if(OfficeInputSecond.Items.Count>0) { OfficeInputSecond.Items.Add(read[1].ToString()); } else { OfficeInputSecond.Items.Add(""); OfficeInputSecond.Items.Add(read[1].ToString()); } } } phoneConn.Close(); . . } So, is it a postback issue? or how can i force the drop down to not change on submit? thanks!
Reply
Answers (
1
)
I use the VS2005 february ctp, but my problems:
How to have WindowsForm component public access for other classes?