0

This is pretty basic guys but i really dont know how to do this.

okay.

i have to panels on my webpage.

what i need to do is i need to hide panel..

i have this

<script runat = "server">
        private void hidepanel()
        {
            pnl_Add.Visible = true;
            pnl_List.Visible = false;
        }    
    </script>

if i click the name, it will hide the panel(the panel which have this code)

<a href="#" onclick ='hidepanel()'><%# Eval("First_name") %> <%# Eval("Last_name") %></a>

i just started asp.net only yesterday. hope you can help me!

thanks guys!!

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by jbisono
0

Can you show the code for the panels as well? Also what scripting language are you using? It doesn't look like javascript, yet you have a clientside event?

0

First of all, if you want to trigger a server side method, I will use a LinkButton Control instead of <a> tag.

<asp:LinkButton ID="lnkBtn" runat="server" Text="Hide Panel" OnClick="hidepanel"></asp:LinkButton>

Now in your c# code

protected void hidepanel(object sender, EventArgs e)
{
   pnl_Add.Visible = true;
   pnl_List.Visible = false;
}

if you want client side then is a little bit different.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.