codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Listbox populating textbox with first record not selected item on PostBack  bubberz at 23:30 on Wednesday, May 04, 2005
 

What I want to do is populate a text box located right above the list box with the listbox's item selected, so I tried the following for the list box:

Private Sub listResource_SelectedIndexChanged

txtBox.Text = list.SelectedItem.ToString()

End Sub

The above code only populates the listbox's first item.
I do have "PostBack"=True for the listbox.

The whole picture of what I'm doing is populating two ddls before the listbox's SQL statement is built. Both the first and second ddls have "AutoPostBack"=True, and the first is built on Page_Load, while the second ddl is built on the first ddl Private Sub ddl1_SelectedIndexChange handler. The listbox is built on the second ddl Private Sub ddl2_SelectedIndexChage handler. The problem is when the listbox has an item that's selected, the postback happens, and the textbox populates with the first record, and not the one I selected!









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  onChange issue
•  Remote program execution using cgi-perl
•  Chat application
•  How to send multiple perameters in SOAP request.
•  Java code for Insert picture on the table in spreadsheet
•  Re: Problem with concatenation
•  how to genrates the crystal report by sending a id at runtime
•  help me
•  pls help me with this..


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007