如何在ASP.NET MVC 3创建自定义编辑/显示模板? [英] How to create custom editor/display templates in ASP.NET MVC 3?

查看:237
本文介绍了如何在ASP.NET MVC 3创建自定义编辑/显示模板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想进行自定义编辑模板在ASP.NET MVC不同的数据类型(与 Html.EditorFor使用()),包括改写现有的模板。最终的目标是建立一个小型的框架,每个编辑器支持约被更改JavaScript的通知,我可以显示信息给用户,有在页面中保存的更改。 (也许有中已有的东西吗?)

I would like to make custom editor templates for different data types in ASP.NET MVC (to use with Html.EditorFor()), including rewriting the existing templates. The ultimate goal is to create a mini-framework where each editor supports javascript notifications about being changed, and I can show a message to the user that there are unsaved changes in the page. (Maybe there's something existing already?)

我能找到属于此类模板问题很多问题,但无处我可以找到创造他们的教程或手册。他们去哪里?有没有什么特殊的语法?如何做一个模板,得到选择?哪些信息是在模板中可用,如何访问它?等等。

I can find many questions pertaining to problems with such templates, but nowhere can I find a tutorial or manual on creating them. Where do they go? Is there any special syntax? How does a template get selected? What information is available in the template and how do I access it? Etc.

所以 - 我在哪里可以找到所有关于这些模板

So - where can I find out all about these templates?

推荐答案

检查并下载ASP.NET MVC 3期货的 HTTP://aspnet.$c$cplex.com/releases/view/58781 并看到默认的源$ C ​​$ C的外观。注:这适用于MVC 4以及

Check and download ASP.NET MVC 3 Futures on http://aspnet.codeplex.com/releases/view/58781 and see how the default source code looks. Note: this works for MVC 4 as well.

这篇关于如何在ASP.NET MVC 3创建自定义编辑/显示模板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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