Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Child controls within Calendar control

Reply
Thread Tools

Child controls within Calendar control

 
 
Sanjay
Guest
Posts: n/a
 
      07-30-2004
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
this.Controls.Add(Control) Does Not Add Control to child collection (this.Controls.Count == 0) Chad Scharf ASP .Net 3 10-18-2007 03:53 PM
ASP.NET Templated User Controls - Limit child controls allowable within a templated control JohnyStyles@gmail.com ASP .Net 0 05-29-2006 06:00 PM
Control.Controls bug? Control's child controls missing at the run time. sinelnikov.andrei@gmail.com ASP .Net Building Controls 1 12-08-2005 06:47 AM
HELP! Child controls of child controls not visible to web app lisa@starways.net ASP .Net Building Controls 0 05-05-2005 09:14 PM
How do I: Main thread spawn child threads, which child processes...control those child processes? Jeff Rodriguez C Programming 23 12-09-2003 11:06 PM



Advertisments