Child controls within Calendar control

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top