Author: Melt16 | Posted on: 9/21/2009 7:49:21 AM | Views : 404

I have a Calendar control on my web page. In each day cell, I have created a button, and link this button to a click event. The button does not fire the click event when clicked on. Why would that be?
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e) { Button unClaimButton = new Button(); unClaimButton.Text = "Reverse Claim"; unClaimButton.CommandArgument = e.Day.Date.ToString(); unClaimButton.Click += new EventHandler(unClaimButton_Click); } protected void unClaimButton_Click(object sender, EventArgs e) { DateTime claimDate = Convert.ToDateTime(((Button)sender).CommandArgument); Response.Write("You clicked on this date " + claimDate.ToString()); }
 
...

Go to the complete details ...