M
MrFraggle
Hi
I'm trying to write a server control that contains the
collapsiblePanelExtender from the ajax toolkit. But I have the
following error when i try to show this control:
Extender control 'ctl00$contentHolder$ctl00$Ant_baseModule1_cpeDemo' is
not a registered extender control. Extender controls must be registered
using RegisterExtenderControl() before calling
RegisterScriptDescriptors().
I have no idea what i must add or change to make it working. Anyone
who has an idea? Or maybe I'm doing it all wrong?
This is my code:
Protected Overrides Sub Render(ByVal output As HtmlTextWriter)
'Detail Label
Dim aDetailLabel As New Label
aDetailLabel.ID = Me.UniqueID & "_lblHeaderDetails"
aDetailLabel.Text = "(Show Details...)"
'Header Panel
Dim headerPanel As New Panel
headerPanel.ID = Me.UniqueID & "_moduleHeader"
'Content Panel
Dim contentPanel As New Panel
contentPanel.ID = Me.UniqueID & "_moduleContent"
'Image
Dim headerImage As New Web.UI.WebControls.Image
headerImage.ID = Me.UniqueID & "imgHeader"
headerImage.ImageUrl = "~/images/expand_blue.jpg"
'Add Content to header panel
Dim aDiv As New LiteralControl
aDiv.Text = "<div class=""cpeHeader"">"
aDiv.Text &= " <div class=""cpeHeaderTitle"">" & Title &
"</div>"
aDiv.Text &= " <div class=""cpeHeaderDetails"">" &
renderControlToString(aDetailLabel) & "</div>"
aDiv.Text &= " <div class=""cpeHeaderImage"">" &
renderControlToString(headerImage) & "</div>"
aDiv.Text &= "</div>"
headerPanel.Controls.Add(aDiv)
'Output header panel
output.Write(renderControlToString(headerPanel))
contentPanel.RenderBeginTag(output)
MyBase.Render(output)
contentPanel.RenderEndTag(output)
'Output Ajax functionality
Dim collPanel As New
AjaxControlToolkit.CollapsiblePanelExtender
collPanel.ID = Me.UniqueID & "_cpeDemo"
collPanel.TargetControlID = Me.UniqueID & "_moduleContent"
collPanel.ExpandControlID = Me.UniqueID & "_moduleHeader"
collPanel.CollapseControlID = Me.UniqueID & "_moduleHeader"
collPanel.Collapsed = False
collPanel.TextLabelID = Me.UniqueID & "_lblHeaderDetails"
collPanel.ExpandedText = "(Hide Details...)"
collPanel.CollapsedText = "(Show Details...)"
collPanel.ImageControlID = "imgHeader"
collPanel.ExpandedImage = "~/images/collapse_blue.jpg"
collPanel.CollapsedImage = "~/images/expand_blue.jpg"
collPanel.SuppressPostBack = True
collPanel.Page = MyBase.Page
collPanel.RenderControl(output)
End Sub
Thx for your help!
I'm trying to write a server control that contains the
collapsiblePanelExtender from the ajax toolkit. But I have the
following error when i try to show this control:
Extender control 'ctl00$contentHolder$ctl00$Ant_baseModule1_cpeDemo' is
not a registered extender control. Extender controls must be registered
using RegisterExtenderControl() before calling
RegisterScriptDescriptors().
I have no idea what i must add or change to make it working. Anyone
who has an idea? Or maybe I'm doing it all wrong?
This is my code:
Protected Overrides Sub Render(ByVal output As HtmlTextWriter)
'Detail Label
Dim aDetailLabel As New Label
aDetailLabel.ID = Me.UniqueID & "_lblHeaderDetails"
aDetailLabel.Text = "(Show Details...)"
'Header Panel
Dim headerPanel As New Panel
headerPanel.ID = Me.UniqueID & "_moduleHeader"
'Content Panel
Dim contentPanel As New Panel
contentPanel.ID = Me.UniqueID & "_moduleContent"
'Image
Dim headerImage As New Web.UI.WebControls.Image
headerImage.ID = Me.UniqueID & "imgHeader"
headerImage.ImageUrl = "~/images/expand_blue.jpg"
'Add Content to header panel
Dim aDiv As New LiteralControl
aDiv.Text = "<div class=""cpeHeader"">"
aDiv.Text &= " <div class=""cpeHeaderTitle"">" & Title &
"</div>"
aDiv.Text &= " <div class=""cpeHeaderDetails"">" &
renderControlToString(aDetailLabel) & "</div>"
aDiv.Text &= " <div class=""cpeHeaderImage"">" &
renderControlToString(headerImage) & "</div>"
aDiv.Text &= "</div>"
headerPanel.Controls.Add(aDiv)
'Output header panel
output.Write(renderControlToString(headerPanel))
contentPanel.RenderBeginTag(output)
MyBase.Render(output)
contentPanel.RenderEndTag(output)
'Output Ajax functionality
Dim collPanel As New
AjaxControlToolkit.CollapsiblePanelExtender
collPanel.ID = Me.UniqueID & "_cpeDemo"
collPanel.TargetControlID = Me.UniqueID & "_moduleContent"
collPanel.ExpandControlID = Me.UniqueID & "_moduleHeader"
collPanel.CollapseControlID = Me.UniqueID & "_moduleHeader"
collPanel.Collapsed = False
collPanel.TextLabelID = Me.UniqueID & "_lblHeaderDetails"
collPanel.ExpandedText = "(Hide Details...)"
collPanel.CollapsedText = "(Show Details...)"
collPanel.ImageControlID = "imgHeader"
collPanel.ExpandedImage = "~/images/collapse_blue.jpg"
collPanel.CollapsedImage = "~/images/expand_blue.jpg"
collPanel.SuppressPostBack = True
collPanel.Page = MyBase.Page
collPanel.RenderControl(output)
End Sub
Thx for your help!