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


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;

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 only yesterday. hope you can help me!

thanks guys!!

Recommended Answers

All 2 Replies

Member Avatar

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?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.