473,322 Members | 1,405 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Templated User Controls

gchq
96
Hi there

I'm attempting to get a Templated User control to work, but for some reason the Template teg

Expand|Select|Wrap|Line Numbers
  1.  
  2. <asp:PlaceHolder ID="PlaceHolder1" runat="server">
  3.  
  4.     <DivTemplate>
  5.  
  6.     <asp:Panel ID="Panel1" runat="server" Width="200" Height="300"></asp:Panel>
  7.  
  8.     </DivTemplate>
  9.     </asp:PlaceHolder>
  10.  
  11.  
Is not being recognised

Here is the code behind

Expand|Select|Wrap|Line Numbers
  1.  
  2. Imports System.ComponentModel
  3.  
  4.  
  5. <ParseChildren(True)> _
  6. <PersistChildren(False)> _
  7. Partial Public Class Secure_Admin_ExpandingPanel
  8.  
  9.     Inherits System.Web.UI.UserControl
  10.     Implements INamingContainer
  11.     Private _DivTemplate As ITemplate = Nothing
  12.     Public HeaderText As String = "Header Text"
  13.     Public HeaderLabel As String = "Open"
  14.  
  15.  
  16.  
  17.  
  18.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  19.         Header_Label.Text = HeaderLabel
  20.         Header_Text.InnerHtml = HeaderText
  21.         CollapsiblePanelExtender1.TargetControlID = "PanelHidden"
  22.         CollapsiblePanelExtender1.ExpandControlID = "Header1"
  23.         CollapsiblePanelExtender1.CollapseControlID = "Header1"
  24.         CollapsiblePanelExtender1.Collapsed = True
  25.         CollapsiblePanelExtender1.ImageControlID = "Image1"
  26.         CollapsiblePanelExtender1.CollapsedImage = "~\Images\plus.gif"
  27.         CollapsiblePanelExtender1.ExpandedImage = "~\Images\minus.gif"
  28.         CollapsiblePanelExtender1.TextLabelID = "Header_Label"
  29.         CollapsiblePanelExtender1.CollapsedText = "Display"
  30.         CollapsiblePanelExtender1.ExpandedText = "Hide"
  31.         CollapsiblePanelExtender1.CollapsedSize = 0
  32.         CollapsiblePanelExtender1.ExpandedSize = 300
  33.         CollapsiblePanelExtender1.ScrollContents = True
  34.     End Sub
  35.  
  36.  
  37.  
  38.     <PersistenceMode(PersistenceMode.InnerProperty), TemplateContainer(GetType(TemplateControl))> _
  39.       Public Property DivTemplate() As ITemplate
  40.         Get
  41.             Return _DivTemplate
  42.         End Get
  43.         Set(ByVal value As ITemplate)
  44.             _DivTemplate = value
  45.         End Set
  46.     End Property
  47.  
  48.     Protected Overrides Sub OnInit(ByVal e As EventArgs)
  49.         MyBase.OnInit(e)
  50.         If _DivTemplate IsNot Nothing Then
  51.             _DivTemplate.InstantiateIn(DivTemplate)
  52.         End If
  53.  
  54.     End Sub
  55.  
  56.  
  57. End Class
  58.  
  59.  
Any ideas where this might be going wrong?

Thanks
Jul 25 '08 #1
0 795

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: smrao0906 | last post by:
Hi, I am using a templated user control which has expand and collapse feature like windows XP explorer.But I have a problem.I set the ParseChildren as "true" so that the controls b/w the template...
2
by: | last post by:
Hello All, I am having a lot of difficulty trying to bind a templated column, that is programmatically created for a datagrid, to a datasource column. I have a datasource containing 2 columns,...
0
by: Jeff Dockman | last post by:
Background: We needed the ability to create a templated web site that may change in layout from installation to installation. To accomplish this, we created a base Page class that all pages in...
0
by: Adrijan Josic | last post by:
Ok I have made a templated user control using the sample in help that is used like this: <General:WebPage id="WebPage1" runat="server"> <Header> header </Header> <Left> <asp:Button
0
by: John Crowley | last post by:
I keep running into this over and over again... I want a block server control that renders a header and footer, and child controls in between. But I don't want a templated control, for the...
1
by: Hasani \(remove nospam\) | last post by:
The way the system works is, you create a user control (ascx) that will be a template and must implement the interface IPageTemplate. You then create one or more user controls (ascx) that implement...
1
by: Frédéric Mayot | last post by:
Hi, I built a very simple templated user control but unfortunately, the template "Content" is not recognized by intellisense and it says that my component "SubForm" is not supposed to contain...
0
by: JohnyStyles | last post by:
I have a templated user control which looks like this: ----------------------------------------------------------------- <uc:MyUserControl runat=server> <TemplateProperty> </TemplateProperty>...
0
by: Mike | last post by:
Hi. I can't figure out why a button's click event is not firing in a templated control I've created (first time I've tried creating one). Please can someone help? On a point of lesser importance,...
0
by: David Rees | last post by:
Before I was using LoadControl and a slew of User Controls to achive the same effect, but I realised a custom TemplatedControl was the better way of doing it. Anyway, this is the templated...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.