如何建立在ASP.Net MVC的复合或模板控件或equivelant? [英] How do build a composite or template control in ASP.Net MVC, or the equivelant?

查看:111
本文介绍了如何建立在ASP.Net MVC的复合或模板控件或equivelant?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我们当前的ASP.Net Web表单应用程序,我们有一个只存在一个共同的外观和感觉的几个复合/模板服务器控件。例如,我们有一个具有一个标题,对于相关的面板的内容按钮的地方,当然内容的面板控制。这是如何最好的MVC实现的呢?的RenderPartial没有得到做什么,我需要在这里。如果我仍然使用相同的控制,但只是一个视图页面上?这些控制并不真正为了一个共同的外观做任何事情上回发,他们只有在那里和感觉。

In our current ASP.Net Webforms application we have several composite/template server controls that only exist for a common look and feel. For example, we have a panel control that has a title, a place for buttons related to the contents of the panel, and of course the contents. How is this best accomplished in MVC? RenderPartial doesn't get done what I need here. Should I still be using the same controls, but just on a view page? These controls don't really do anything on postback, they are only there for a common look and feel.

更多信息:

我们在Web表单实现ICompositeControl控制。我们对此的控制面板一样(型面板)的一些属性,按钮(再次输入面板,将举行按钮)和字符串类型的属性标题。在视觉上,它看起来像

We have a control in Webforms that implements ICompositeControl. We have a few properties on this control like Panel (type Panel), Buttons (again type Panel which would hold buttons) and a property Title of type string. Visually it looks like

推荐答案

模板化的部分景色是要走的路。

这篇关于如何建立在ASP.Net MVC的复合或模板控件或equivelant?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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