更改asp.net向导中“下一步”按钮的功能
我有一个ASP向导,包括四个步骤更改asp.net向导中“下一步”按钮的功能,asp.net,visual-studio-2010,wizard,Asp.net,Visual Studio 2010,Wizard,我有一个ASP向导,包括四个步骤 添加客户id 添加项目iD 添加位置 定稿 我不希望用户在不输入ID的情况下进行下一步操作并跳过任何步骤。 我尝试了所有事件并搜索了很多次,但“下一步”和“上一步”按钮仍能正常工作 我还想完成可点击侧栏超链接的选项 if (e.CurrentStepIndex == 1) { if (LabelCustomerNotify.Text == "notset") { LabelCustomerN
if (e.CurrentStepIndex == 1)
{
if (LabelCustomerNotify.Text == "notset")
{
LabelCustomerNotify.Text = "You can not proceed without selecting customer id";
Wizard1.ActiveStepIndex = 1;
}
else
{
Wizard1.ActiveStepIndex++;
}
}
else if (e.CurrentStepIndex == 2)
{
if (LabelItemNotify.Text == "notset")
{
LabelItemNotify.Text = "You can not proceed without selecting Item id";
Wizard1.ActiveStepIndex = 1;
}
else
{
Wizard1.ActiveStepIndex++;
}
}
else if (e.CurrentStepIndex == 3)
{
Wizard1.ActiveStepIndex++;
}
我在Wizard1\u ActiveStepChanged、Wizard1\u NextButtonClick等事件中输入了此代码
请帮助我使用属性取消移动到下一步(在NextButtonClick
事件中),而不是您当前的方法:
if (e.CurrentStepIndex == 1)
{
if (LabelCustomerNotify.Text == "notset")
{
LabelCustomerNotify.Text = "You can not proceed without selecting customer id";
e.Cancel = true;
}
}
如果它仍然不能正常工作,我将运行一个调试器,并确保您的代码实际上正在输入If块。你可能只是有一个问题的条件