Home » Applications » Access » Monthly Event Calendar – Control parameter query

Monthly Event Calendar – Control parameter query


ASP.NET Toolbox calendar control which use control parameter to query db records and display event(s) on calander item selection change. This is suitable for deisplaying events on PostBack call on the same page.


  1. Events.mdb / or MS SQL
  2. Web.config
  3. Month-2.aspx
  4. Month-2.aspx.vb
  5. Dtgrid.css


  1. Create table Events (Id [primary key – AutoNumber], Event [Text], DateFrom [Date/Time], DateTo[Date/Time].
  2. Enter some data in the table
  1. Create/re-write web.config file (download web.config file here)
  2. Add New Item and name it Month-2.aspx or whatever you like
  3. Import dtgrig.css (downolad dtgrid.css file here)
  4. Drag calendar control from toolbox to designer
  5. Double click designer and in code behind create two subs: Page_Load and Calender1_SelectionChanged

  1. Drag “Events” table from Server Explorer to designer; Configure Data Source WHERE DateFrom = Control  – Calendar1 and add it to a SQL expression.
  2. Configure css property for your calendar and grid view and you are good to go.

1 Respond for Monthly Event Calendar – Control parameter query

  1. MikeJD says:

    To display today’s events on page_load event follow these steps:
    1. In code-behind file re-name var dd to cDay in page_load event
    2.In code-behind file add * Session(“cDay”) = cDay * in page_load and calendar1_selectionchanged events below every defined variable
    3. Change the selection parameter in an AccessDataSource to * sessionparameter Name=”DateFrom” SessionField=”cDay” Type=”DateTime” *