.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Create databound nested ajax toolkit accordion programatically(In code Behind)

Posted By:      Posted Date: August 24, 2010    Points: 0   Category :ASP.Net

Can anyone guide me in the right direction or give an example of How I would accomplish this?


I have  this so far but kind of stuck on how to do it programtically if I'm using header and content templates 

I have a xmldatasource.. In a nutshell at what point in my code do I need to create a new accordion? does it need to be

in the item_databound handler?


Imports Microsoft.VisualBasic

Public Class AccordionTemplate
    Implements System.Web.UI.ITemplate

    Dim templateType As String

    Sub New(ByVal type As String)
        templateType = type
    End Sub

    Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) _
          Implements System.Web.UI.ITemplate.InstantiateIn

        Dim ph As New PlaceHolder()

        Select Case (templateType)
            Case "Header"
                Dim myLabel As Label = New Label()
                myLabel.Text = "Test"
            Case "Content"
                ph.Controls.Add(New LiteralControl("<p>hello</p>"))
        End Select
    End Sub

End Class



Partial Class Accordion
    Inherits System.Web.UI.Page


View Complete Post

More Related Resource Links

how to create wsse:Security header programatically from code



I want to create the following wsse:Security header from C# code:

<wsse:Security s:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <wsu:Timestamp wsu:Id="Timestamp-02be6222-d34d-4c19-bb35-f4e98cc18534" xmlns:wsu="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss- wssecurity-utility-1.0.xsd">
  <wsse:UsernameToken wsu:Id="SecurityToken-3f7f983f-66ce-480d-bce6-170632d33f92" xmlns:wsu="

Building a grouping Grid with GridView and ASP.NET AJAX toolkit CollapsiblePanel

I've posted an update to this post to apply on demand loading of Details data using ASP.NET AJAX PageMethods. I'm demonstrating the usage if CollapsiblePanelExtender client events on the new post. Check it out.

I admit, Matt Berseth is really inspiring me! Few days ago I pass through 2 of his great posts:

.Surrounding your Data Table and Dialog Controls with ComponentArt Styled Panels
.Building a Grouping Grid with the ASP.NET 3.5 LinqDataSource and ListView Controls
The first one is pure design tips one which I used for making good presentation of my demo here. The 2nd post is actually the idea.

I thought this would be simple... Trying to create a login does an ajax check before submit


I have the standard .net login control that is working.  (Still learning .net after 15yrs of classic)

What I want to do is OnButtonClick run a javascript function (to do an ajax call to the db to check if login is valid or not) and if it returns true, then submit the form normally, else don't submit. The piece that I can't figure out, is how to correctly override the default click even to hit my JS routine and then submit the form properly afterwards.

Thanks ahead of time

MVC2 issue - Stuck. Trying to create a cms with nested partials


I am currently trying to display multiple items on a single page. I am not sure as to how to tackle this. What I have is a database table that has all the page data in. I have this run as a PagesController and this works fine. However what I would like to do is, if say the Products page is selected via the menu, I want to pull back not only the Products page html but also get all the products, and even be able to pull them through via category. I was trying to use a partial view, but I can't get it to work. The same would be for other pages, having partial views to display the other content, ie if Gallery is selected, the page html for Gallery shows and it then can push to a partial view that pulls all the gallery images from the gallery db table and so on. 

Maybe I am tackling this the wrong way. I have the pages stored in the db to allow for a CMS system I have setup. Maybe I need to use models for all the other items(Products, Gallery, Videos and such) and use the partial for the page html?

Any help would be greatly appreciated as I am confused.

VWDE 2010 Won't Install Ajax Control Toolkit on XP Pro


To my displeasure I cannot find VWD2005 which at one time would generate a complete web.config for Ajax so I downloaded and installed VWDE 2010 to a clean install of XP Pro.

I've created a new tab on the toolbar for the controls but after I select the Ajax dll to add the controls to the toolbar it grinds away and then goes poof and closes down the task leaving VWD look as if I had never even created the tab in the toolbar. 


Any advice here?

Create/add table from code to database



I create table:

                  DataSet data=new DataSet();

                  DataTable myTable = new DataTable("NewTable");

                   DataColumn[] keys = new DataColumn[1];

                   // create column
                   keys[0] = new DataColumn();
                   keys[0].DataType = System.Type.GetType("System.String");
                   keys[0].ColumnName = "PointID";
                   myTable.Columns.Add(keys[0]);    &nb

Wicked Code: Drag and Drop with ASP.NET AJAX


Jeff Prosise shows how you can implement drag-and-drop functionality in your Web app with ASP.NET AJAX.

Jeff Prosise

MSDN Magazine January 2008

C#: Create Elegant Code With Anonymous Methods, Iterators, And Partial Classes


In this article Juval Lowy describes how exciting new features in Visual Studio 2005, that will improve your overall productivity compared to the first version of C#, so you can write cleaner code faster.

Juval Lowy

MSDN Magazine Visual Studio 2005 Guided Tour 2006

C# 2.0: Create Elegant Code with Anonymous Methods, Iterators, and Partial Classes


C# 2.0 introduces a wealth of exiting new features, such as generics, iterators, partial classes and anonymous methods. While generics are the most talked-about feature especially for former classic C++ developers, the rest of the new features are important additions to your .NET development arsenal, enhancing power and improving overall productivity. This article is dedicated to all the new C# 2.0 capabilities besides generics to give you a good overall picture of the upcoming features.

Juval Lowy

MSDN Magazine May 2004

Code Name Avalon: Create Real Apps Using New Code and Markup Model


The presentation subsystem in the next version of Windows, code-named "Longhorn," offers powerful new capabilities to developers. This subsystem, code-named "Avalon," allows developers to take advantage of its capabilities through a new markup language code-named "XAML." In addition, modern object-oriented programming languages such as C# and Visual Basic .NET can be used to tie everything together. Because most applications written to Avalon will probably be a mix of XAML and programming code, this article discusses XAML tags used to control page layout along with the procedural code written to respond to events.

Charles Petzold

MSDN Magazine January 2004

Think that there is actually errors in ajax toolkit for 2.0 framework...hmm


Im using VS2008, asp.net C# 2.0.


Recently i tryed to correct some stuff on my page and i had a friend to take a look at the stuff...


What i did was that i have Examples page with code examples. Then accordion panes for each code piece...And syntaxhighlighter for each code piece. The code that i presented is read from the txt files wich makes it easyer for me to put new examples on the site...

But the problem is now that two of my accordion panes are not working...and everything works in all other browsers this just happens in Internet Explorer. This is kind of weird and my friends explaination was that there is actually errors in the ajax toolkit dll.


Im using the latest version of ajax toolkit for framework 2.0 wich is 1.0.20229.

My friend said its actually amazing that the toolkit has been out there for that long and it has not been tested that well and that there i still errors in it.


You can test this by your self by doing the exact as i explain:


go here: http://www.simpa.dk/Examples.aspx?cookieCheck=true

click Csharp

and try to open the accordion that is from the bottom 2 or 1 they dont collapse...

but this works in all other browsers then Internet Explore

Create a Outlook Task from Custom WebPart in Code



I have a requirement to create a Outlook Task , from a custom webpart through code .

Is this possible?

has any body tried this , if yes can you please give me an insight on how to acheive it.

Some sample Code would be highly appreciated.



Ajax Accordion to load data from client click event


I have a Ajax Accordion control on my page with treeview in Content Template. As the treeview for each pane are big. I am wondering whether I can load the treeview from codebehind only after the pane is selected. I can reuse the code from ItemDataBound of Accordion control.

Ajax toolkit for visual studio 2005


Plz give me the ajax toolkit download link for visual studio 2005.   

plz plz plzFrown

Ajax AutoComplete VB Code HELP!


hey guysim new to the site so bare with me. Im not sure if this has been asked before and sorry if it has.

ive been trying to figure out some code for autocomplete and everything I seem to do comes up blank.

my DataBase is called ReviewDB

the table I want to access is called Game

the Colum Name I want to retrevie is GameTitle

Dataset is call ReviewDataSet

ConnectionString is Called ReviewDBConnectionString

Webservice is called AutoComp.asmx

Im trying to get a search TextBox to Autocomplete a list of GameTitles From my DataBase. that onced send will postback to my viewGames.aspx page to display the information about that game.

Im not sure if this is even the best way todo it if you guys have better suggestions on how to search and retrive my games from the database then all ideas welcome.

thanks dave

Problem with AJAX control toolkit


Hi guys

i'm newbie to AJAX usage.

i'm using visual web developer 2008 express edition

i downloaded AjaxControlToolkit.Binary.NET35 from codeplex site.

i extracted the zip file.

I added the toolbox to visual web developer by adding a new tab naming it ajax kit.

added tools to it by choose item and selected AjaxControlToolkit.dll ,the one i unzipped.

AJAX tools appear in toolbox.Even after using script manager tool,when i drag one of the contols for example autocompleteextender,i get a circle with black diagonal line indicating i cant use the tool

Why is it so..

when i hard code the the controls in tags in source tab ,i dont get an error but i dont get the tool in design view...

the following lines are also present

<%@ Register assembly="System.Web.Extensions, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI" tagprefix="asp" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="ajaxToolkit" %>

Can anyone plz help me...

It's urgent

Thank u

create a dynamic view on code

How i can create a new view on code (on runtime) if this view dont exits?   Thanks
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend