Monthly Calendar Control

N

newsgroups.jd

Anyone know where I can find a calendar control that just shows the
months, not the days.

Something like

<< Jan 2006 >>

left and right arrows would up or down the month, year and then
clicking on the month could redirect.

JD
 
B

Bruno Alexandre

u can do it yourself using atlas (to prevent refreshing the hole page) and
asp:linkbutton
or using a simple javascript for that...

<asp:linkbutton id="prv" runat="server" text="<<" onclick="move(-1)" />
<asp:linkbutton id="dte" runat="server" />
<asp:linkbutton id="nxt" runat="server" text=">>" onclick="move(1)" />

sub move( where as integer )

dim a as array
dim m, y as integer
a = split( dte.text, " " ) ' we split the month and year by the space
between the 2 values
select case a(0).tostring.tolower
case "january"
m = 1
case "february"
m = 2
case "march"
m = 3
...
end select

m += where

if m > 12 then ' if the month is bigger, we set the month to january and add
1 to the year
m = 1
y = cint(a(1)) + 1
elseif m < 1 then ' otherwise we set the month to december and move back 1
year
m = 12
y = cint(a(1)) - 1
end if

' the new date string to present
dte.text = monthname(m) & " " & y

end sub


in the page_load event inside if not page.ispostback set the dte.text =
monthname( datepart(month, datetime.today ) ) & " " & datepart(year,
datetime.today )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top