Home » Applications » Monthly Event Calendar – Query String Parameter

Monthly Event Calendar – Query String Parameter

Description:

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

Elements:

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

Method:

  1. Create table Events (Id [primary key – AutoNumber], Event [Text], DateFrom [Date/Time], DateTo[Date/Time].
  2. Enter some data in the table
  3. Create/re-write web.config file (download web.config file here)
  4. Add New Item and name it Month-2.aspx or whatever you like
  5. Import dtgrig.css (downolad dtgrid.css file here)
  6. Drag calendar control from toolbox to designer
  7. Double click designer and in code behind create two subs: Page_Load and Calender1_SelectionChanged
  8. Redirect page to your liking (highlighted). In this case I redirected hit to a same page and I am using query string to display record(s) below the calendar. You can use new page, pop-up window or jQuery to call data
  9. Drag “Events” table from Server Explorer to designer; Configure Data Source WHERE DateFrom = QueryString – dd (querystring field value) and add it to a SQL expression.
  10. Configure css property for your calendar and grid view and you are good to go.