Monday, April 23

Create Dynamic Accordion With multiple AccordionPane

Here i am Going to Post My Both Source And Page Behind code

My Source Code:-

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head runat="server">
   <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        <asp:Panel ID="Panel1" runat="server">


My Page Behind Code:-

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AjaxControlToolkit;
public partial class Default2 : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
        Accordion acrd = new Accordion();
        acrd.ID = "Accordion1";
        acrd.BorderStyle = BorderStyle.Solid;
        acrd.BorderColor = System.Drawing.Color.Black;
        acrd.BackColor = System.Drawing.Color.Gray;
        //This is for first Accordian Pane
        AccordionPane acpane = new AccordionPane();
        acpane.ID = "Shibashish";

        Label lbl = new Label();
        lbl.Text = "jay(Click Me To Open)   Accordionpane1";
        acpane.HeaderContainer.BorderStyle = BorderStyle.Double;
        acpane.HeaderContainer.BackColor = System.Drawing.Color.Green;
          TextBox txt = new TextBox();
        txt.Text = "om namah shivaya";
        acpane.ContentContainer.Controls.Add(new LiteralControl("</br>This is my dynamic Accordian application"));

        //This is for Second Accordian Pane
        AccordionPane acpane1 =  new AccordionPane();
        acpane1.ID = "Mohanty";
        acpane1.HeaderContainer.Controls.Add(new LiteralControl("Jagdish(Click Me To Open)    Accordionpane2"));
        acpane1.HeaderContainer.BorderStyle = BorderStyle.Double;
        acpane1.HeaderContainer.BorderColor = System.Drawing.Color.Blue;
        acpane1.HeaderContainer.BackColor = System.Drawing.Color.YellowGreen;
        TextBox txt1 = new TextBox();
        txt1.Text = "om namah ganesh";

        //Added the contents object in AccordionPane

        //Added the AccordionPane object in Accordion
        //Added the Accordion object in Panel


Thanks Shibashish Mohanty

No comments:

Post a Comment

Please don't spam, spam comments is not allowed here.

shibashish mohanty