Child controls within Calendar control

Discussion in 'ASP .Net Web Controls' started by Sanjay, Jul 30, 2004.

  1. Sanjay

    Sanjay Guest

    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
    Sanjay, Jul 30, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    2,213
  2. Jeff Rodriguez
    Replies:
    23
    Views:
    1,086
    David Schwartz
    Dec 9, 2003
  3. Chad Scharf
    Replies:
    3
    Views:
    858
    Chad Scharf
    Oct 18, 2007
  4. Replies:
    0
    Views:
    194
  5. Replies:
    0
    Views:
    81
Loading...

Share This Page