UserControl没有名为ContentTemplate的公共属性 [英] UserControl does not have public property named ContentTemplate

查看:97
本文介绍了UserControl没有名为ContentTemplate的公共属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题已经问了几十遍了;但从未解决.

This question has been asked a few dozen times before; but has never been solved.

我有一个 UpdatePanel

i have an UpdatePanel

<asp:UpdatePanel ID="UpdatePanelSetupToolbar" runat="server">
   <ContentTemplate>
      ...           
   </ContentTemplate>
</asp:UpdatePanel>      

但是Visual Studio(2010(Professional(Windows(7(Professional(64-bit))))))中的 visual page designer 出现错误:

But the visual page designer in Visual Studio (2010 (Professional (Windows (7 (Professional (64-bit)))))) gives the error:

创建控件时发生错误-UpdatePanelSetupToolbar

Error Creating Control - UpdatePanelSetupToolbar

类型'System.Web.UI.UserControl'没有名为'ContentTemplate'的公共属性.

Type 'System.Web.UI.UserControl' does not have a public property named 'ContentTemplate'.


在漂亮的屏幕截图中添加漂亮的颜色以达到漂亮的效果

现在,严格来讲,这是真的: 没有没有名为ContentTemplate的公共属性.

Now, strictly speaking, that is true: UserControl does not have a public property called ContentTemplate.

幸运的是,我的UpdatePanel UpdatePanel ,并且确实具有名为

Fortunately my UpdatePanel is an UpdatePanel, and it does have a public property named 'ContentTemplate'.

那么我如何说服Visual Studio我的UpdatePanelUpdatePanel?

So how do i convince Visual Studio that my UpdatePanel is an UpdatePanel?

上面的代码实际上并没有按原样失败:

The code above doesn't actually fail as is:

<asp:UpdatePanel ID="UpdatePanelSetupToolbar" runat="server">
   <ContentTemplate>
      ...           
   </ContentTemplate>
</asp:UpdatePanel>  

仅当我在... ContentTemplate中包含内容时,它才会失败:

It only fails when i have content inside the ... ContentTemplate:

    <asp:UpdatePanel ID="UpdatePanelSetupToolbar" runat="server">
        <ContentTemplate>
            <Vista:Toolbar ID="ToolbarSetup" runat="server">
                <ContentTemplate>
                    <asp:LinkButton ID="bbSetupDays" ToolTip="Specify how many allocations will be available on these selected days"
                    OnClick="bbSetupDays_Click"                                        
                    runat="server">Setup Selected Days</asp:LinkButton>         
                </ContentTemplate>
            </Vista:Toolbar>        
        </ContentTemplate>
    </asp:UpdatePanel>      

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆