Solved

What is the best way to dynamically hide / show a panel?

Posted on 2011-09-28
3
530 Views
Last Modified: 2012-05-12
I'm trying to dynamically show / hide a panel (and subsequently it's contents), based the value chosen in a drop down list. I think i can do this in jQuery though I'm not sure if  that is the most efficient / best way, or if there is a simpler / easier / faster / more resourceful way to accomplish this. Any help or links to help would be appreciated.
0
Comment
Question by:mikesExpertExchange
3 Comments
 
LVL 8

Assisted Solution

by:jagrut_patel
jagrut_patel earned 200 total points
ID: 36812830
jQuery would be definitely more efficient way to do this.

$('#<%=panel1.ClientID %>').hide();

$('#<%=panel1.ClientID %>').show();

This will show/hide the panel along with the content within the panel.
0
 
LVL 25

Accepted Solution

by:
Luis Pérez earned 300 total points
ID: 36813082
$('#comboID').change(function() {
    //Here you got some options, depending on if the panel must show for an unique value
    //or for a set of values

    //If only one value shows the panel (and all the other values hide it), then it could be:
    if($(this).value == 'value_desired_for_showing') {
        $('#panelID').show();
    } else {
        $('#panelID').hide();
    }

    //If several values show the panel and another ones hide it, you can use
    switch($(this).value) {
        case 'value_showing_1':
        case 'value_showing_2':
        case 'value_showing_3':
            $('#panelID').show();
            break;
        default:
            $('#panelID').hide();
    }
});

Hope that helps.
0
 
LVL 1

Author Closing Comment

by:mikesExpertExchange
ID: 36816926
i split the points, because my main question (the question in the title) was answered with the first response. Though the 2nd response completely answered my entire question (in the question details). Thanks to the both of you for your contributions
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Obtaining data on ASP 8 30
Generate Unique ID in VB.NET 21 68
C#.net split string and then check appropriate checkboxlist 4 27
Change to file doesn't show up 16 56
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

830 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