本文介绍了Ajax手风琴-内置代码不调用ItemDataBound的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在vb代码中构建一个Accordion控件(如下所示),该控件调用ItemDatabound事件.

我有一个aspx声明性示例作为可以正常工作的测试,它使用HeaderTemplate和ContentTemplate.

我认为这可能是我错了,可能是我需要使用Accordion1.ContentTemplate.

有没有人举过这样的例子创建手风琴并调用Item事件?


 使用 Accordion1

            ' -添加标题-
             Dim  As  新建标签
            head.ID = "  LblHeader" 
            head.Text = " 标签" 

             Dim 对应 As  新建 AjaxControlToolkit.AccordionPane
            accpane.HeaderContainer.Controls.Add(head)

            ' -添加数据-
             Dim 数据 As  新建标签
            Data.ID = "  LblData" 
            Data.Text = " 标签" 

            accpane.ContentContainer.Controls.Add(数据)

            Accordion1.Panes.Add(accpane)

结束 使用


受保护的  Sub  Accordion1_DataBound( ByVal 发​​送者目标 对象 ByVal  e  As  AjaxControlToolkit.AccordionItemEventArgs)句柄 Accordion1.ItemDataBound

       ' -做某事

结束  
解决方案




How do I build an Accordion control in vb code (as shown below) that calls the ItemDatabound event.

I have an aspx declarative example as a test which works, this uses a HeaderTemplate and ContentTemplate.

I''m thinking that is where I may be wrong, may be I need to use Accordion1.ContentTemplate.

Does anyone have an example of an Accordion built this way, and calling Item events?


 With Accordion1

            '- add header -
            Dim head As New Label
            head.ID = "LblHeader"
            head.Text = "label"

            Dim accpane As New AjaxControlToolkit.AccordionPane
            accpane.HeaderContainer.Controls.Add(head)

            '- add Data -
            Dim Data As New Label
            Data.ID = "LblData"
            Data.Text = "label"

            accpane.ContentContainer.Controls.Add(Data)

            Accordion1.Panes.Add(accpane)

End With


Protected Sub Accordion1_DataBound(ByVal sender As Object, ByVal e As AjaxControlToolkit.AccordionItemEventArgs) Handles Accordion1.ItemDataBound

       '- Do something

End Sub
解决方案




这篇关于Ajax手风琴-内置代码不调用ItemDataBound的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 03:33