Calendar DayRender even in

Posted on 2011-10-20
Last Modified: 2012-05-12
Hello experts,

I am trying to understand the Calendar DayRender event and the many uses we can apply it to. In my search on the internet I came across the following code which is in C# and I couldn't understand both the first and last lines of that shot code which can be found at the following address:

My request is to translate these four lines of code into


CalendarDay d = ((DayRenderEventArgs)e).Day; 
        TableCell c = ((DayRenderEventArgs)e).Cell;    
        if ( !d.IsOtherMonth )    
            c.Controls.Add(new LiteralControl(dr["EventDetails"].ToString()));

Open in new window

Question by:adamtrask
    LVL 20

    Accepted Solution

       Protected Sub Cal_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Cal.DayRender
            'CalendarDay d = ((DayRenderEventArgs)e).Day;
            'TableCell c = ((DayRenderEventArgs)e).Cell;    

            'If (!d.IsOtherMonth) Then
            '    c.Controls.Add(new LiteralControl(dr["EventDetails"].ToString()));

            Dim d As CalendarDay = e.Day
            Dim c As TableCell = e.Cell

            If Not d.IsOtherMonth Then
                c.Controls.Add(New LiteralControl(datareaderyoudidntinclude("EventDetails"))
            End If
        End Sub

    Author Comment

    Thank you so much ddayx10:


    Author Closing Comment

    Thanks again
    LVL 20

    Expert Comment


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now