Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
297 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

839 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