Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8114781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:15:20+00:00 2026-06-06T03:15:20+00:00

I have an ASP.Net Calendar control that, on DayRender, loops through a list of

  • 0

I have an ASP.Net Calendar control that, on DayRender, loops through a list of “CalendarEvents” (one of my classes). If the day that DayRender is on is in the list of CalendarEvents, then fill that calendar cell with the details of the event.

In my test environment, there is no problem, but I imagine with thousands of records, it might become a problem. Here is what I’m doing:

public partial class calendar : System.Web.UI.Page
{
    CalendarEventList allevents = CalendarEventManager.GetListAll();

    //Page_Load, etc...

    protected void calmaincalendar_DayRender(object sender, DayRenderEventArgs e)
    {
        foreach (CalendarEvent x in allevents)
        {
            if (e.Day.Date == x.EventDate)
            {
                //logic to extract the data from x, and modify the e.Cell to display that data
            }
        }
    }
}

My questions are:

1) I’m putting the events as a page level variable, so that the database only needs to be called once, and not on every single DayRender. Good, bad? Potential issues? This page is purely to read the Calendar Events, not edit or delete.

2) Looping through the “allevents” list on every DayRender, is that potentially dangerous/resource intensive? Does the Calendar control call DayRender for just the month that’s being displayed? If so, meaning only 30 or 31 calls at a time, it might be fine. But if it does something like calls DayRender for the entire year, or the previous and next months as well…Anyway, hopefully you get my point. Advice on this would be appreciated.

3) Is there anything that I could be doing better? I realize I only posted the bare skeleton, but if anyone has any similar experience, or pitfalls they wished they had realized earlier, that advice would be appreciated.


As I was typing up the questions I realized that when I get the CalendarEventList at the page level, I could immediately loop through it and cut out everything except for the last 3 and future 3 months or something. Problem there is, somehow keeping track of it so that when the user goes back 4 months, I’d have to realize this and call the database again. I have a vague feeling that the answer is somewhere in that direction, but still not sure.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:15:23+00:00Added an answer on June 6, 2026 at 3:15 am

    As you talk about records I guess you have an underlying database. If so, I will suggest to create a query for that, so you can do this:

    foreach (CalendarEvent x in CalendarEventManager.GetForDate(e.Day.Date))
    {
        //logic to extract the data from x, and modify the e.Cell to display that data
    }
    

    This way, you will retrieve just the needed records.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an asp.net calendar control that is used to select a date and
We have a ASP.Net Calendar control, and in the DayRender event, we have the
I have an ASP.Net web user control that contains a TextBox and a calendar
I have an asp.net form that contains some html, 2 controls a calendar from
I have a calendar control on a asp .net webform. In the Pag_Load event
I have an asp.net mvc 2.0 application that contains Areas/Modules like calendar, admin, etc...
I need to manipulate the appearance of the an ASP.NET calendar control. I have
i have added to my page an asp.net calendar control and i would like
I'm attempting to create a custom calendar control that inherits from ASP.Net's built in
I have used Ajax Calendar extender control (from here ) in my asp.net 3.5

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.