S
Sanjay
I am trying to extend the Calendar control to provide for custom binding through datasets etc. Everything is working just find till I try to add LinkButtons within the cells of the calendar. Here is a code snippet.
private void MonthlyCalendar_DayRender( object sender, System.Web.UI.WebControls.DayRenderEventArgs e )
{
....
LinkButton Lb = new LinkButton();
Lb.Text = "Some Link";
Lb.CommandName = "APPT_CLICKED";
Lb.CommandArgument = AppointmentInfoObject.PostbackData;
Lb.Command += new CommandEventHandler( AppointmentClick_EventHandler );
Lb.Style.Add( "font-weight", "normal" );
Lb.Style.Add( "font", e.Cell.Font.Name );
Lb.Style.Add( "font-size", e.Cell.Font.Size.ToString() );
Lb.ToolTip = AppointmentInfoObject.AppointmentDetails;
e.Cell.Controls.Add( Lb );
....
}
While the LinkButton itself gets rendered, there is no clickable link. The content is rendered as plain text. When I look at the HTML, I notice that the href='' has not been specified. It is rendered as -- <a>Some Link</a>.
Any help would be greatly appreciated. Thanks in advance.
Sanjay
private void MonthlyCalendar_DayRender( object sender, System.Web.UI.WebControls.DayRenderEventArgs e )
{
....
LinkButton Lb = new LinkButton();
Lb.Text = "Some Link";
Lb.CommandName = "APPT_CLICKED";
Lb.CommandArgument = AppointmentInfoObject.PostbackData;
Lb.Command += new CommandEventHandler( AppointmentClick_EventHandler );
Lb.Style.Add( "font-weight", "normal" );
Lb.Style.Add( "font", e.Cell.Font.Name );
Lb.Style.Add( "font-size", e.Cell.Font.Size.ToString() );
Lb.ToolTip = AppointmentInfoObject.AppointmentDetails;
e.Cell.Controls.Add( Lb );
....
}
While the LinkButton itself gets rendered, there is no clickable link. The content is rendered as plain text. When I look at the HTML, I notice that the href='' has not been specified. It is rendered as -- <a>Some Link</a>.
Any help would be greatly appreciated. Thanks in advance.
Sanjay