开发者

Design support for templated UserControl

开发者 https://www.devze.com 2022-12-28 18:47 出处:网络
I have created a real simple templated UserControl using the following tutorial: http://msdn.microsoft.com/en-us/library/36574bf6(VS.80).aspx

I have created a real simple templated UserControl using the following tutorial: http://msdn.microsoft.com/en-us/library/36574bf6(VS.80).aspx

I can now add this control to my mvc 2.0 application using:

<components:Box BoxType="Help" Title="Content Title" runat="server开发者_运维问答">
    <Content>
        <%: Html.TextBox("test") %>
        This is my awesome content!<br />
        <b>Test</b>
    </Content>
</components:Box>

However, when I go to the designer, I get an exception: Type 'System.Web.UI.UserControl' does not have a public property named 'Content'.

How can I fix this? I don't even need to use the drag-and-drop designer, just rendering the control will do fine.

Thanks!


The article you read is about ASP.NET WebForms and this won't work in ASP.NET MVC. It is safe to say you can ditch your work and start over.

Create a Partial View or Html Helper for reusable content in ASP.NET MVC.

0

精彩评论

暂无评论...
验证码 换一张
取 消