Dobrý den, mám vytvořený UserControl (WebUserControl1), po umístění UC do požadované stránky a přepnutí do modu "Design" Visual Studio 2010 Profi nezobrazí obsah UC ale vypíše Error Creating Control - WebUserControl11 (Type 'System.Web.UI.UserControl') does not have property named 'Title Template'. Pomuže někdo?
<%@ Register src="UserControls/WebUserControl1.ascx" tagname="WebUserControl1" tagprefix="uc2" %>
<uc2:WebUserControl1 ID="WebUserControl11" runat="server">
<TitleTemplate>
A
</TitleTemplate>
<FooterTemplate>
B
</FooterTemplate>
<DescriptionTemplate>
C
</DescriptionTemplate>
</uc2:WebUserControl1>
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="WebUserControl1.ascx.vb" Inherits="PopUp.WebUserControl1" %>
<div class="contentBox">
<asp:PlaceHolder ID="myTitle" runat="server"></asp:PlaceHolder>
<asp:PlaceHolder ID="myDescription" runat="server"></asp:PlaceHolder>
<asp:PlaceHolder ID="myFooter" runat="server"></asp:PlaceHolder>
</div>
Imports System.Collections
Imports System.Configuration
Imports System.Data
Imports System.Linq
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.HtmlControls
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Xml.Linq
<ParseChildren(True)> _
Public Class WebUserControl1
Inherits System.Web.UI.UserControl
Private _title As ITemplate
Private _description As ITemplate
Private _footer As ITemplate
<PersistenceMode(PersistenceMode.InnerProperty), TemplateContainer(GetType(TemplateControl))> _
Public Property TitleTemplate() As ITemplate
Get
Return _title
End Get
Set(value As ITemplate)
_title = value
End Set
End Property
<PersistenceMode(PersistenceMode.InnerProperty), TemplateContainer(GetType(TemplateControl))> _
Public Property DescriptionTemplate() As ITemplate
Get
Return _description
End Get
Set(value As ITemplate)
_description = value
End Set
End Property
<PersistenceMode(PersistenceMode.InnerProperty), TemplateContainer(GetType(TemplateControl))> _
Public Property FooterTemplate() As ITemplate
Get
Return _footer
End Get
Set(value As ITemplate)
_footer = value
End Set
End Property
Protected Sub Page_Load(sender As Object, e As EventArgs)
End Sub
Protected Overrides Sub OnInit(e As EventArgs)
MyBase.OnInit(e)
If _title IsNot Nothing Then
_title.InstantiateIn(myTitle)
End If
If _description IsNot Nothing Then
_description.InstantiateIn(myDescription)
End If
If _footer IsNot Nothing Then
_footer.InstantiateIn(myFooter)
End If
End Sub
End Class
|