如何在重定向到其他asp.net页面时禁用按钮?
我在Approve.aspx中有两(2)个按钮,分别是bttnVerify和bttnApprove。问题是,在页面加载期间,bttnApprove.visible=false,当用户单击bttnVerify时,它将重定向到另一个页面。重定向下面的页面代码如何在重定向到其他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
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代码>此按钮来自其他页面您是否使用母版页我尝试过,问题是如何禁用从内容页到其他内容页的按钮。