插入-更新-删除 Web GUI
我发现自己经常创建添加/编辑/删除/列表 GUI,以至于我厌倦了它。 一定有一些免费的软件包可以解决这个问题,对吗?
我想要的是这样的:
{
MyApplicationUser user = MyApplication.GetUserByID(1234);
EditForm form = new EditForm("Title: Edit User"); //this is the magic object
form.addFieldsFromObject(user);
}
function onFormSubmit(eventArgs e){
MyApplicationUser user = form.GetSubmittedData();
MyApplication.SaveUser(user);
}
AddFieldsFromObject
会自动创建一个html表单,其中的字段对我提供的对象的公共属性的数据类型进行数学运算。
I find myself creating Add/Edit/Delete/List GUI's so often that I'm sick and tired of it.
There must be some free package that solves this, right?
What I would like is something like this:
{
MyApplicationUser user = MyApplication.GetUserByID(1234);
EditForm form = new EditForm("Title: Edit User"); //this is the magic object
form.addFieldsFromObject(user);
}
function onFormSubmit(eventArgs e){
MyApplicationUser user = form.GetSubmittedData();
MyApplication.SaveUser(user);
}
AddFieldsFromObject
would automatically create a html form with fields mathing the datatype of the public properties of the object I feed it with.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有许多框架试图解决这个问题。 ASP.NET 动态数据可能是一个不错的起点。它使用基于模板的系统,以极少的自定义代码提供基本的 CRUD(创建、检索、更新、删除)用户界面。
ASP.NET MVC 的编辑器模型也做得非常好:
LightSwitch 尝试通过自动生成基本脚手架代码来解决同样的问题,为您提供类似于 Microsoft Access 的体验。但由于它使用实际的 C# 代码,因此如果您发现您的需求超出了项目的原始范围,您可以更改代码以提供更多功能。
There are a number of frameworks that try to solve this problem. ASP.NET Dynamic Data may be a good place to start. It uses a template-based system to provide basic CRUD (Create, Retrieve, Update, Delete) user interfaces with very minimal custom code.
ASP.NET MVC also does a pretty good job with its editor models:
LightSwitch tries to solve this same problem by auto-generating basic scaffolding code for you to produce an experience similar to Microsoft Access. But since it's using actual C# code, you can alter the code to provide more functionality if you find that your needs have grown beyond the original scope of the project.