Solved

How can I make a TextBox mirror the top item in a DropDownList when a button click occurs?

Posted on 2007-04-04
2
295 Views
Last Modified: 2008-03-10
(I have an ASP.net 1.1 application with VB.net coding and VBscripting)

I have a DropDownList box called 'DropDownList1' that is populated with a single value when a button is clicked. How can I make a TextBox mirror this top item in the drop down list when the button click occurs?

0
Comment
Question by:jazjef
  • 2
2 Comments
 
LVL 19

Accepted Solution

by:
DreamMaster earned 500 total points
ID: 18848977
Ok, you are not making complete sense to me...

Are you populating a dropdownlist with just one value? (which is what your question reads like) or are you automatically selecting the correct value in the dropdownlist upon the button click?

If the last option is your scenario, you could try to do the following after you set the value of the dropdownlist

txtMirror.Text = DropDownList1.SelectedValue

or..if the value is numeric and you are using the Text property of the options..

txtMirror.Text = DropDownList1.SelectedText

Regards,
Max.
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 18857300
Glad to have been helpful :)

Regards,
Max.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question