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
293 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
Comment Utility
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
Comment Utility
Glad to have been helpful :)

Regards,
Max.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now