无法将复选框功能设为按钮.请帮忙 [英] cant make the function of check box to a button. please help

查看:69
本文介绍了无法将复选框功能设为按钮.请帮忙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 <div >

  <asp:CheckBox ID="CheckBox1" runat="server" Checked="false" />  <p2> I have read the Terms and Conditions</p2>

<asp:Button ID="Button1" runat="server" Text="Next" Width="110px"/>       
  <asp:Button ID="Button2" runat="server" Text="Back"  Width="110px"/>
 
 </div>





Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    Button1.Enabled = False
    If CheckBox1.Checked = True Then
        Button1.Enabled = True
    End If

End Sub

推荐答案

您应该在设计时或页面加载时禁用按钮,并将复选框条件的代码放置在checkbox事件中. .
You should disable your button in design time or as it is in page load and place your code for the checkbox condition in the checkbox event...


这篇关于无法将复选框功能设为按钮.请帮忙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆