The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Calendar Control

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Scott Watermasysk

Posts: 661
Nickname: scottwater
Registered: Aug, 2003

Scott Watermasysk is an ASP.NET developers. He wrote the .Text blog engine.
Calendar Control Posted: Feb 13, 2004 5:16 AM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Scott Watermasysk.
Original Post: Calendar Control
Feed Title: ScottW's ASP.NET WebLog
Feed URL: /error.aspx?aspxerrorpath=/blog/rss.aspx
Feed Description: ASP.NET and Blogging
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Scott Watermasysk
Latest Posts From ScottW's ASP.NET WebLog

Advertisement

Scott Mitchell has posted a nice article on how to add a calendar control a .Text blog. He is currently using version 0.94. If you choose to drop this control in either version 0.95 or 0.96, I would make the following changes (mostly for consistency)

  1. Instead of deriving from UserControl, derive from .Text's BaseControl. This will get you a reference to the currently requested blog via BaseControl.CurrentBlog
  2. Instead of building the url yourself, use .Text's, UrlFormat class. This way, future url changes (or if you globally decide to change something), can still be done in one place. In addition, in a multi-blog site, the links will point to the correct blog. The instance of UrlFormat you would want to use, is part of the BlogConfig for the current blog (ie, CurrentBlog.UrlFormat). So when you set the value of Cell.Text, it would look something like, Cell.Text = string.Format(“<a href=\“{0}\“>{1}</a>“,CurrentBlog.UrlFormat.DayUrl(e.Day.Date),e.Day.Date.Day);
  3. If you are feeling really adventurous, you can override the OnMonth event and use UrlFormat.MonthUrl to point to the previous and next months.

Either way, its a great contribution. Early versions of .Text included a similar control, but at the time I was having a hard time getting the CSS work properly, so I decided to drop it for now. If you are interested, you can also check out Daniel Cazzulino's style free calendar control which should be much easier to CSS enable.

Read: Calendar Control

Topic: It's not NewsGator, it's MozGator Previous Topic   Next Topic Topic: [Tool] QuickJump - very nice and simple VS.Net add-in

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use