本文介绍了在Asp.net中创建动态向导控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在为我的应用程序使用ASP.Net向导控件.向导步骤不是固定的,它们取决于某些条件.所以我想根据条件创建动态向导.
有人可以帮助我在该向导中创建动态向导控件以及带有必需字段验证器的动态文本框吗?
谢谢
Hi,
I am using ASP.Net Wizard control for my application. the wizard steps are not fixed, they depend on some criteria. so I want to create dynamic wizard based on the criteria.
Can anybody help me to create dynamic wizard control, and dynamic textboxes with requiredfield validators in that wizard?
Thanks
推荐答案
protected void Page_Init(object sender, EventArgs e)
{
Wizard wizard1 = new Wizard();
TextBox text1 = new TextBox();
WizardStep step1 = new WizardStep();
step1.Controls.Add(text1);
step1.ID = "step3";
step1.Title = "Step 3";
TextBox text2 = new TextBox();
WizardStep step2 = new WizardStep();
step2.Controls.Add(text2);
step2.ID = "step4";
step2.Title = "Step 4";
wizard1.WizardSteps.Add(step1);
wizard1.WizardSteps.Add(step2);
wizard_container.Controls.Add(wizard1);
}
这篇关于在Asp.net中创建动态向导控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!