私はasp.netを使用しています。チェックされていないチェックボックスを表示したいのですが、ブラウザではチェックボックスのステータスがtrueで、サーバー側のコードでcheckbox.checked = falseを設定しましたが、ブラウザではチェック済みと表示されます。
これが私のコードです
{<asp:CheckBox ID="SendNotificationCheckBox" runat="server" Checked="false" Enabled="false" oncheckedchanged="SendNotificationCheckBox_CheckedChanged" AutoPostBack="true"/>}
サーバー側でこのコードを試しました:
{ protected void SendNotificationCheckBox_CheckedChanged(object sender, EventArgs e)
{
if (SendNotificationCheckBox.Checked == true)
{
NotificationPanel.Visible = true;
NotificationMessageTextBox.Text = "Business Listing Named:" + BusinessNameLabel.Text.Trim() + " Will Be Expired On" + NextVerificationDateLabel.Text.Trim() + ".Contact Us To Renew it.";
}
else if (SendNotificationCheckBox.Checked == false)
{
NotificationPanel.Visible = false;
}
}}