troubleshooting Question

Question about OnCheckedChanged event

Avatar of Hojoformo
Hojoformo asked on
2 Comments1 Solution306 ViewsLast Modified:
I have questions about events in ASP.NET.  I added an event "OnCheckedChanged" that does not get triggered until a Button event is initiated.  Is there any way to trigger the "OnCheckedChanged" event immediately when the checkbox is selected like a client side event?  For example, when the checkbox is selected, then call server method CheckBox1_CheckedChanged.  

<asp:CheckBox ID="CheckBox1" runat="server" OnCheckedChanged="CheckBox1_CheckedChanged" />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Text="Button" /></div>

public void CheckBox1_CheckedChanged(object sender, EventArgs e)
        DateTime todaysdate = DateTime.Now;
        TextBox2.Text = todaysdate.ToString();

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros