Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/visual-studio-2010/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
更改asp.net向导中“下一步”按钮的功能_Asp.net_Visual Studio 2010_Wizard - Fatal编程技术网

更改asp.net向导中“下一步”按钮的功能

更改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

我有一个ASP向导,包括四个步骤

  • 添加客户id

  • 添加项目iD

  • 添加位置

  • 定稿

  • 我不希望用户在不输入ID的情况下进行下一步操作并跳过任何步骤。 我尝试了所有事件并搜索了很多次,但“下一步”和“上一步”按钮仍能正常工作

    我还想完成可点击侧栏超链接的选项

        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块。你可能只是有一个问题的条件