简体   繁体   English

如何在asp.net页面上动态添加控件并根据之前添加的控件进行填充?

[英]How to add controls dynamically on asp.net page and fill it according to previously added controls?

I am developing a system going to be used by RESOURCE MANAGERS of a training institute.我正在开发一个系统,供培训机构的资源经理使用。 Resource manager schedules batches for different skills at different centers and assign faculties to conduct particular batch.资源经理为不同中心的不同技能安排批次,并分配教员进行特定批次。

 **Batches  Timings   27-Jun-11    28-Jun-11    29-Jun-11   30-Jun-11  1-Jul-11**
                         Mon         Tue         Wed         The        Fri

Center-1    9am to 4pm    Skill1   Skill2       Skill3     Skill4      Skill5
Batch-1                 Faculty1   Faculty3      Faculty1  Faculty1   Faculty1

Center-2    9am to 4pm  Skill4     Skill2        Skill1    Skill3      Skill5
Batch-2                Faculty2    Faculty2      Faculty2   Faculty2   Faculty2

Center-3    9am to 4pm  Skill1     Skill3        Skill2    Skill4      Skill5
Batch-3                 Faculty3   Faculty1     Faculty3   Faculty3    Faculty3

Resource manager schedules one batch for particular center for a week at once, then he comes down to schedule a next batch for other center for the same week.资源经理一次为特定中心安排一个批次,为期一周,然后他下来为其他中心安排下一批同一周。

At the time of scheduling the batch there would be dropdownlists for batches, centers,skills and faculties.在安排批次时,会有批次、中心、技能和学院的下拉列表。 Resource manager selects each values from dropdownlists.资源管理器从下拉列表中选择每个值。

Conditions to implement this page:实现此页面的条件:

  1. In Row: each skill dropdown should not contain skill which is scheduled in any of the previous date for the same batch.在行中:每个技能下拉列表不应包含在同一批次的任何前一个日期安排的技能。

  2. In Column: each batch dropdownlist should not contain previously scheduled batches.在列中:每个批次下拉列表不应包含先前计划的批次。

  3. In Column: each faculty dropdown should not contain same faculty which is occupied for the same date and time.在列中:每个教师下拉列表不应包含在相同日期和时间占用的相同教师。

Now I am confused about how i implement this page so that i can able to render and fill each dropdown with appropriate values.现在我对如何实现这个页面感到困惑,这样我就可以用适当的值渲染和填充每个下拉列表。 Should I use handlers to fill dropdownlist dynamically or any other jquery/javascript ideas to implement this.我应该使用处理程序来动态填充下拉列表还是使用任何其他 jquery/javascript 想法来实现这一点。 I would be thankful if i will get some help to sort it out.如果我能得到一些帮助来解决这个问题,我将不胜感激。

Thanks, Aarti谢谢,阿尔蒂

The best option would be to fire the validations for the constraints you require upon submit .最好的选择是在submit时为您需要的约束触发验证。

Any ways or else if you have decided to make your page look dynamic, I suggest you to use javascript/jquery .任何方式,或者如果您决定让您的页面看起来动态,我建议您使用javascript/jquery As using handlers would make your page take more time on rendering response on each select .因为使用处理程序会使您的页面在每个selectrendering response时花费更多时间。

Here is a jquery example that would help you get closer to what you need. 是一个 jquery 示例,可以帮助您更接近您的需求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM