Click here to Skip to main content
15,890,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<%@ Page Title="" Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeFile="testingt.aspx.cs" Inherits="testingt" EnableEventValidation="true" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
   
     <asp:CheckBox ID="CheckBox1" Text="I agree" runat="server" OnCheckedChanged="CheckBox1_CheckedChanged1" AutoPostBack="true"  ViewStateMode="Enabled" EnableViewState="true" />
     <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
       <div class="col-md-6">
        <div class="form-group">
         <asp:DropDownList ID="ddlSenderID" runat="server" Enabled="true"  class="form-control" OnSelectedIndexChanged="ddlSenderID_SelectedIndexChanged" AutoPostBack="true" EnableViewState="true" ViewStateMode="Disabled">
               <asp:ListItem Text="SENDER ID" Value="0"></asp:ListItem>
                <asp:ListItem Text="HADIYA" Value=""></asp:ListItem>
                   </asp:DropDownList>
                   </div>
                    </div>
</asp:Content>


What I have tried:

 protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
        }
     }
         protected void ddlSenderID_SelectedIndexChanged(object sender, EventArgs e)
         {
         }

         protected void CheckBox1_CheckedChanged1(object sender, EventArgs e)
         { 
             TextBox1.Text = "testingg"; 
         }
}
Posted
Updated 20-Oct-18 5:26am

Your code is correct. There may be some javascript problem. Just copy your code to a new page and check if the OnCheckedChanged is calling on that page.
 
Share this answer
 
Comments
Member 14024377 20-Oct-18 9:20am    
@Yogis...thanx

yeah...OncheckedChanged is firing in plain page...but when I use master page it is not working.

How can I find Javascript Problem.....Please Help
Yogi S. 20-Oct-18 13:41pm    
In web forms such problems occur when page gets corrupted. The only solution is to copy your code one by one on the new page. Remember when you copy the code one by one , keep on checking if the oncheckedchanged event is firing or not.
Member 14024377 21-Oct-18 0:08am    
thanks......

its javascript problem...i removed a javascript..now its working
@Yogis 
when I inspect on checkbox from google chrome its showing following JavaScript code.How can I disable this

<input id="ctl00_ContentPlaceHolder1_CBIndividual" type="checkbox" name="ctl00$ContentPlaceHolder1$CBIndividual" onclick="javascript:setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$CBIndividual\',\'\')', 0)" style="position: absolute; visibility: hidden;">
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900