ARTICLE

Using Ajax Control Toolkit in ASP.NET

Posted by Davin Martyn Articles | ASP.NET AJAX in VB.NET September 14, 2011
In this article we can easily implement any Ajax control Toolkit in ASP.NET page and with the help of this article we prepare any application in easily way.
 
Reader Level:

Introduction : How can use Accordion and AccordianPane control in ASP.NET Ajax Control Toolkit.

The Accordion Control derives from the webcontrol class. It is use conjunction with Accordiaonpane control which represent the actual Panes. The Accordionpane Control are held <Pane> tag of the Accordion Control.

Step 1 : Open visual studio and go to file menu.

  • We select website option.

  • Now we will install Ajax Control Toolkit.

  • We select ASP.NET page.

  • Default.aspx page will be open.
ASP-page1.gif

Step 2 : Go to solution explorer and right click.
  • Select add new items.

  • Now we select webform and add in page.

  • Now click in source option and write a code.
webforms.gif

Code :

<title>my ajax application</title>
</head>
<
body>
    <form id="form1" runat="server">
<
div>
      <asp:ScriptManager ID="ScriptManager1" runat="server">
 </asp:ScriptManager>
<PANES>
        <asp:AccordionPane ID = "AccordiOnpane2" runat ="server">
        <Header>
        <div style ="background-color:Red;">Section1</div>
      </Header>
        <Content>
        TCS<br/>
        INFOSYS<br/>
        WIPRO<br />
 </Content>
 </asp:AccordionPane>
        <asp:AccordionPane ID = "AccordionPane3" runat = "server">
<
Header>
        <div style = "background-color:Red;">section2</div>
        </Header>
        </asp:AccordionPane>
        </PANES>
</
asp:Accordion>
         </div>
        </form>
        </body>
 </html
>

Step 3: Go to toolbox option and select a control.

  • Select Accordian and AccordionPane, Scriptmanager Control.

control-page.gif

Step 4 :
Now we can define StyleSheet with Accordian Control.
  • Write a code for StyleSheet.

Code :

<
title>my Ajax Application</title>
    <style type ="text/css">
        .Accordion
        {
            width:230px;
        }
        .Accordion header
        {
            border:120px;
            background-color:Gray;
            border-color:Green;
            font:110px;
            font-size:20px;
            cursor:pointer;
        }
         .Accordionheaderselected
        {
            border:100px;
            color:Lime;
            font:110px;
            cursor:pointer;
        }
        .Accordion content
        {
            border:120px;
            color:Lime;
            font:110px;
            cursor:pointer;
        }
 </style
>

Step 5: Now we press F5 and run this application and find out result.

output1.gif

Login to add your contents and source code to this article
share this article :
post comment
 
Nevron Diagram
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor