Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.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 - Fatal编程技术网

如何在重定向到其他asp.net页面时禁用按钮?

如何在重定向到其他asp.net页面时禁用按钮?,asp.net,Asp.net,我在Approve.aspx中有两(2)个按钮,分别是bttnVerify和bttnApprove。问题是,在页面加载期间,bttnApprove.visible=false,当用户单击bttnVerify时,它将重定向到另一个页面。重定向下面的页面代码 Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim()) If Captcha1.UserValidated Then lblMessage.ForeColor = Sy

我在Approve.aspx中有两(2)个按钮,分别是bttnVerify和bttnApprove。问题是,在页面加载期间,bttnApprove.visible=false,当用户单击bttnVerify时,它将重定向到另一个页面。重定向下面的页面代码

     Captcha1.ValidateCaptcha(txtCaptcha.Text.Trim())
    If Captcha1.UserValidated Then
        lblMessage.ForeColor = System.Drawing.Color.Green
        Response.Redirect("~/Accounts/AccountsApproval/" & Session("IDs"))

    Else
        lblMessage.ForeColor = System.Drawing.Color.Red
        lblMessage.Text = "InValid"
    End If
从上面的代码中,当验证其captcha时,我想禁用该页面中的特定按钮,即bttnApprove和bttnVerify.visible=true

提前谢谢。

试试这个

    If Captcha1.UserValidated Then
        lblMessage.ForeColor = System.Drawing.Color.Green
        Response.Redirect("~/Accounts/AccountsApproval/" & Session("IDs"))
        bttnApprove.Enable = false
    Else
        lblMessage.ForeColor = System.Drawing.Color.Red
        lblMessage.Text = "InValid"
        bttnVerify.Enable = false
    End If

您可以通过设置属性
按钮来启用或禁用按钮。启用
使用
bttnApprove.enable=false

此按钮来自其他页面您是否使用母版页我尝试过,问题是如何禁用从内容页到其他内容页的按钮。