Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
121
rated 0 times [  125] [ 4]  / answers: 1 / hits: 15714  / 13 Years ago, wed, september 21, 2011, 12:00:00

I'm using asp.net(C#) under visual studio 2010



I have a panel that is by default set 2 be hidden( visible=false)



I need to create a JavaScript function that would be executed on a button click to make this panel visible if hidden and hidden if visible.
and this should be client side, here is the code I have so far



   <script type=text/javascript>

function func1()
{
i need this code please
}

<asp:Panel ID=ResultsPanel runat=server>

Some controls

</asp:Panel>

<asp:button id=button1 runat=server onclick=javascript:func1()>Hide/Unhide</asp:button>

More From » asp.net

 Answers
21

If you are using jQuery, you may make use of following jQuery methods,



http://api.jquery.com/toggle/



http://api.jquery.com/hide/



http://api.jquery.com/show/


[#89998] Monday, September 19, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jenamackennac

Total Points: 304
Total Questions: 110
Total Answers: 107

Location: Ecuador
Member since Thu, Jun 4, 2020
4 Years ago
jenamackennac questions
Fri, Feb 18, 22, 00:00, 2 Years ago
Wed, Apr 21, 21, 00:00, 3 Years ago
Thu, Apr 1, 21, 00:00, 3 Years ago
Tue, Feb 2, 21, 00:00, 3 Years ago
;