Wrox Programmer Forums
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 18th, 2007, 03:14 PM
Registered User
 
Join Date: Jul 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default dropdownlist change

This may not be an asp.net specific question, but here goes. I have a drop down list and I would like to hide and unhide a textbox based on the text of the dropdown list. I am sure I can do this, but I am not finding much help on how to do it. Can anyone out there help me?

Thanks in advance.

Jim
 
Old July 18th, 2007, 10:14 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Handle the SelectedIndexChanged event of the dropdown in your event do something like


switch(this.ddl.SelectedItem.Value)
{
    case "val":
        this.txt.Visible = true;
    break;
    case "anotherVal":
        this.txt.Visible = false;
    break;
}

hth

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Dropdownlist index change event problem. thanigaimani83 ASP.NET 1.x and 2.0 Application Design 0 November 7th, 2007 06:40 AM
about dropdownlist selected change event chandra_yvr ASP.NET 2.0 Basics 0 April 2nd, 2007 07:20 AM
DropDownList jameee ASP.NET 2.0 Professional 1 October 18th, 2006 02:21 AM
How can i change the textbox into a dropdownlist saif44 ASP.NET 2.0 Basics 1 March 5th, 2006 04:20 PM
dropdownlist msrnivas .NET Web Services 0 March 4th, 2004 11:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.