开发者

Design support for templated UserControl

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜