来自数据库的动态控制负载 [英] Dynamic Control load from database

查看:88
本文介绍了来自数据库的动态控制负载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



实际情况是这样.考虑一下我们有不同类型的贷款,例如房屋贷款,车辆贷款等.这两种贷款形式都有一些共同的领域和不常见的领域.我想将这些字段存储在数据库中.然后,用户根据贷款类型选择特定控件应从数据库中加载的内容.

请用样本编码详细提出解决方案.

谢谢

Hi,

The actual scenario is this. Consider we have different types of loans like home loan, vehicle loan etc. both the loan forms have some common fields and uncommon fields. i want to store these fields in database. then the user choosing upon the the type of loan the specific controls should load from database.

Kindly suggest solution in detail with a sample coding .

Thanks

推荐答案

vinmca写道:

我要从数据库中加载控件

I want to load the controls from database


在其余的问题中,您在哪里使用过此功能?您是说要/正在将用户A/B选择保存在DB中吗?


Where did you used this in the rest of your question? Are you saying you want/are saving the User A/B choices in DB?

vinmca写道:

请提出一个解决方案


将选择保存在DB,Session,QueryString等中.您可以使用任何状态管理技术,这些技术将为您提供用户A在第1页中选择的控件.
在第2页中,获取所选控件的数据,动态创建并放置它们.默认情况下,您可以在第2页中放置一个面板,以便可以向该面板添加控件.


Save the choices in a DB, Session, QueryString, etc. You can use any state management technique that will provide you the controls selected by User A in page 1.
In page 2, get the data of selected controls, create it dynamically and place them. By default, you can put a panel in Page 2, such that you can add controls to that panel.


vinmca写道:

实际上我必须制定两种类型的报告.一个报告包含10个控件,另一个报告包含15个控件,其中第二个报告的5个控件有所不同.所以通常我将控件放在数据库中,并希望基于特定的报告显示控件.

Actually i have to develop 2 types of reports . one report contains 10 controls and another report contains 15 controls where only 5 controls of the 2nd report vary . so commonly i put the controls in DB and want to Display the controls based on a particular report.



基于此,您已将控件保存在DB中.您只需要获取列表并在Page load中动态创建这些控件以显示它们.

假设您有报告A:2个文本框,1个下拉列表和& 1个按钮保存在数据库中.
在页面加载中,获取此信息,然后可以准备一个开关盒.根据控件的类型和数量,创建该控件-计算次数.



Based on this, you have the controls saved in DB. You simple need to fetch the list and dynamically create those controls in Page load to display them.

So lets say, you have for Report A: 2 textboxes, 1 dropdown & 1 button saved in DB.
In page load, get this info, and you can have a switch case in place. based on the control type and count, create that control - count number of times.


这篇关于来自数据库的动态控制负载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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