Asp.net dropdownlist
Asp.net dropdownlist
Asp.net dropdownlist
Asp.net dropdownlist
Asp.net dropdownlist
Asp.net dropdownlist Asp.net dropdownlist Asp.net dropdownlist Asp.net dropdownlist Asp.net dropdownlist Asp.net dropdownlist Asp.net dropdownlist Asp.net dropdownlist
Asp.net dropdownlist Asp.net dropdownlist
Asp.net dropdownlist
Go Back  Xtreme Visual Basic Talk > > > Asp.net dropdownlist


Reply
 
Thread Tools Display Modes
  #1  
Old 01-30-2011, 08:47 PM
youngsc youngsc is offline
Centurion
 
Join Date: Oct 2008
Posts: 121
Default Asp.net dropdownlist


On a page in the project I have two dropdownlists which are populated from an xml file. There's a an action where the user can leave that page to select a value and once they do will be returned to the page mentioned above. This is where I'm running into problems. I've tried everything I can think of to repopulate the dropdownlist with the value the user selected before leaving the page, the textboxes work fine so it's not a matter of how I'm storing or retrieving that value. Thus far I've tried the following:

dropdownlist.text = "Text"
dropdownlist.selectedvalue = "Text"
dropdownlist.Items.SelectedText("Text").Selected = True
dropdownlist.SelectedIndex = 1 (any value other than -1)

I've tried changing this to an ajax combobox control. I've also tried changing AutoPostback to true or false. No matter what I've done it's not placing the saved value back for the user to see.

When I run it line by line I can see the value stored is there however when it passes over the dropdownlist there is no change.

Again I would appreciate any ideas you all could give me.
Reply With Quote
  #2  
Old 01-30-2011, 09:12 PM
youngsc youngsc is offline
Centurion
 
Join Date: Oct 2008
Posts: 121
Default

Ugh, sorry to keep replying to my own threads but I can't stand not figuring these things out myself. I think I've figured out the problem but still don't understand why the commands above won't work. It seems that in between pages it's not preserving the list of items populated from the XML file. So the next step is to simply lay out the code so that it repopulates the list then assigns it's value.

This is actually more "correct" I guess because if it only populated the previously selected value and not the list a few users might be ticked they couldn't view all the other values.

thanks to those that looked and sorry again for replying to my own threads, just hoping my rants will help others.
Reply With Quote
  #3  
Old 04-12-2011, 08:40 AM
JustinCase2 JustinCase2 is offline
Junior Contributor
 
Join Date: Apr 2006
Posts: 324
Default Have you tried...

dropdownlist.selectedItem ?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Asp.net dropdownlist
Asp.net dropdownlist
Asp.net dropdownlist Asp.net dropdownlist
Asp.net dropdownlist
Asp.net dropdownlist
Asp.net dropdownlist Asp.net dropdownlist Asp.net dropdownlist Asp.net dropdownlist Asp.net dropdownlist Asp.net dropdownlist Asp.net dropdownlist
Asp.net dropdownlist
Asp.net dropdownlist
 
Asp.net dropdownlist
Asp.net dropdownlist
 
-->