Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 30th, 2003, 12:21 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default setting default month

Hi,

I have an asp.net web page where clinics log in to save their last month's visit count.

I currently have the following code to set the month field, so that the month displayed is the previous month:

            lblMonth.Text = UCase(MonthName(Month(System.DateTime.Today)-1)) & " " & (Year(System.DateTime.Today))

What I need to do is have the month change on the 3rd day before the end of the month.

For example, if the date was 6/25/2003, the month displayed would be MAY 2003. If the system date was 6/27/2003, I want the month displayed to be JUNE 2003. Can anyone **************** me how to modify my code to do this?

Thank you,

John
  #2 (permalink)  
Old June 30th, 2003, 12:44 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Wien, Wien, Austria.
Posts: 158
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to NotNowJohn
Default

Code:
lblMonth.Text=DateTime.Now.AddDays(3).ToString("MMMM yyyy")
...but the Soon is eclipsed by the Moon


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting default value in drop down. rupen Classic ASP Basics 4 July 3rd, 2014 02:00 AM
Setting the default.aspx for all users Caster BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 April 13th, 2007 02:45 AM
setting default values prithvi28 XSLT 1 October 3rd, 2006 01:38 PM
query Current Month, Month+1, Month+2, Month+3 anterior Access 2 September 24th, 2006 08:25 PM
Setting Default Value at run time skinny Access 1 October 3rd, 2005 06:51 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.