从数据库值动态生成MVC中的文本框 [英] Dynamic generation of textbox in MVC from database value

查看:90
本文介绍了从数据库值动态生成MVC中的文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的数据库中,我有一个名为control_id的列,其值为1,2,3,4。基于此值,我必须生成文本框,下拉列表和复选框等控件。 (例如,如果我的control_id为1,则必须生成文本框,并为2,下拉列表等)我对MVC完全不熟悉。任何人都可以指出我正确的方向来实现这个场景吗?



我尝试过:



我是MVC的新手,文本框应该来自数据库

In my database, i have a column called control_id which consists value like 1,2,3,4. Based on this value, i have to generate controls like Text box, Dropdownlist and Check box. (For example, if my control_id is 1, has to generate Text box, and for 2, dropdownlist and so on) I am completely new to MVC. Can anyone point me in right direction to implement this scenario?

What I have tried:

I'm new to MVC the textbox should be from database

推荐答案

学习基础知识(MVC,Razor等)是个好主意)在处理这样的项目之前。在跑步前学会走路。



这是一个好的起点: ASP .NET MVC | ASP.NET站点 [ ^ ]
Would be a good idea to learn the basics (MVC, Razor, etc) before tackling a project like this. Learn to walk before your run.

Here is a good place to start: ASP.NET MVC | The ASP.NET Site[^]


这篇关于从数据库值动态生成MVC中的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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