Assume that i am creating 2 Panel which depends on which buttons ( 2 buttons ) user clicked..
if the user click button 1, panel 1 will visible and panel 2 will not be visible.. same to the button 2..
but it can't be work don't know due to what, i had tried many of others pattern of the visible still cannot be work. :/

here is my .css coding

 protected void radCreditCard_CheckedChanged(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (radCreditCard.Checked == true)
                {
                    pnlCreditCard.Visible = true;
                    pnlPayPal.Visible = false;
                }
                else
                {
                    pnlCreditCard.Visible = false;
                    pnlPayPal.Visible = true;
                }
            }


        }

        protected void radPaypal_CheckedChanged(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {

                if (radPaypal.Checked == true)
                {
                    pnlCreditCard.Visible = false;
                    pnlPayPal.Visible = true;
                }
                else
                {
                    pnlCreditCard.Visible = true;
                    pnlPayPal.Visible = false;
                }
            }
        }

and this is my deisgn code.

  <asp:Panel ID="pnlCreditCard" runat="server" Visible="False">Credit Card</asp:Panel>
             <asp:Panel ID="pnlPayPal" runat="server" Visible="False"></asp:Panel>

i've solve the problem already, since i do it in server-side..
so i have put the AutoPostBack="true" for both radiobutton

but i have a problem,
how can i create a new function in css file combine both of them function (CheckedChanged) and call this function at .aspx?

Be a part of the DaniWeb community

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