AJAX Panel control
-
Hi I have the below code and what I would like it to do is when I click on the button a panel will appear, click on it again and it will dissapear. Thats all but the below code doesnt seem to work can any1 point me in the right direction? thanks fdgdfgdfg
-
Hi I have the below code and what I would like it to do is when I click on the button a panel will appear, click on it again and it will dissapear. Thats all but the below code doesnt seem to work can any1 point me in the right direction? thanks fdgdfgdfg
Have you thought of using JavaScript and not using the UpdatePanel control at all? From experience the UpdatePanel is not a great control and if all you are looking to do is toggle the display of a block-level element, then the following would be far easier in my opinion: Your JavaScript...
function toggleDisplay(toggleDiv) { toggleDiv = document.getElementById(toggleDiv); if (toggleDiv.style.display != 'none') toggleDiv.style.display = 'none'; else toggleDiv.style.display = 'block'; }
Your HTML...<asp:Button OnClientClick="toggleDisplay('toggleDiv'); return false;" ID="btn_search_by_area1" runat="server" Text="Search Sub Dep." /> <div id="toggleDiv"> ghjgjhgg </div>
Clean code is the key to happiness.