ASP.NET School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

 

Code Snippets

  

ASP Source Code


Welcome to Dream.In.Code
Become a ASP.NET Expert!

Join 300,308 ASP.NET Programmers for FREE! Get instant access to thousands of ASP.NET experts, tutorials, code snippets, and more! There are 2,097 people online right now. Registration is fast and FREE... Join Now!





ASP Calendar Month view

Free for learning

Submitted By: root_hacker
Actions:
Rating:
Views: 7,664

Language: ASP

Last Modified: June 25, 2005
Instructions: copy paste code

Snippet


  1. Ok here is the month view of asp calander written by me and only me
  2. Code start from line below
  3. =================
  4. <%
  5. function tagdates
  6. End function
  7.  
  8. function drawcalander
  9. '===================== calculating values for drawing calander
  10. if request.QueryString("date")="" then
  11. current_date=date()
  12. else
  13. current_date=request.QueryString("date")
  14. End if
  15. current_month=month(current_date)
  16. current_year=year(current_date)
  17. current_day=day(current_date)
  18. first_day_month=day(dateserial(current_year,current_month,01))
  19. last_day_month=day(dateserial(current_year,current_month+1,1-1))
  20. weekday_monthfirst=weekday(dateserial(current_year,current_month,01))
  21. weekday_today=weekday(dateserial(current_year,current_month,current_day))
  22. '======================================
  23. 'response.write "<br>current date ="&current_date&"<br>"
  24. 'response.write "<br>current month ="&current_month&"<br>"
  25. 'response.write "<br>year ="&current_year&"<br>"
  26. 'response.write "<br>todays date ="&current_day&"<br>"
  27. ''response.write "<br>first day of month ="&first_day_month&"<br>"
  28. 'response.write "<br>last day of month is ="&last_day_month&"<br>"
  29. 'response.write "<br>weekday position of first day="&weekday_monthfirst&"<br>"
  30. 'response.write "<br>weekday position of todayss day="&weekday_today&"<br>"
  31. ' response.write "<br>first day of fiven week is="&dateadd("d",-(weekday_today-1),current_date)&"<br>"
  32. response.write "<table border=1>"
  33. response.write "<tr>"
  34. response.write "<td colspan=7>"
  35. response.write "<a href=test.asp?date="&dateadd("m",-1,current_date)&"><<</a> "
  36. response.write monthname(current_month)&", "&current_year
  37. response.write " <a href=test.asp?date="&dateadd("m",+1,current_date)&">>></a>"
  38. response.write "</td>"
  39. response.write "</tr>"
  40. response.write "<tr>"
  41. response.write "<td>"
  42. response.write "S"
  43. response.write "</td>"
  44. response.write "<td>"
  45. response.write "M"
  46. response.write "</td>"
  47. response.write "<td>"
  48. response.write "T"
  49. response.write "</td>"
  50. response.write "<td>"
  51. response.write "W"
  52. response.write "</td>"
  53. response.write "<td>"
  54. response.write "Th"
  55. response.write "</td>"
  56. response.write "<td>"
  57. response.write "F"
  58. response.write "</td>"
  59. response.write "<td>"
  60. response.write "Sa"
  61. response.write "</td>"
  62. response.write "</tr>"
  63. response.write "<tr>"
  64. for i=1 to 7
  65. if i>weekday_monthfirst-1 then
  66. response.write "<td>"
  67. days=days+1
  68. response.write days
  69. response.write "</td>"
  70. else
  71. response.write "<td>"
  72. response.write " "
  73. response.write "</td>"
  74. End if
  75. next
  76. for j=1 to 5
  77. response.write "<tr>"
  78. for i=1 to 7
  79. if days<last_day_month then
  80. days=days+1
  81. response.write "<td>"
  82. response.write days
  83. response.write "</td>"
  84. End if
  85. Next
  86. response.write "</tr>"
  87. Next
  88. response.write "</tr>"
  89. response.write "</table>"
  90.  
  91. End function
  92.  
  93. function najam
  94. 'response.write "inside function"
  95. a="najam is great"
  96. najam=a
  97. end function
  98. %>
  99. <%
  100. a=najam
  101. drawcalander
  102. %>

Copy & Paste


Comments


Kavita Doshi 2009-06-04 23:50:17

It's really useful mi in future, as i think to put calendar view. Thanks.


Add comment


You must be registered and logged on to </dream.in.code> to leave comments.





Live ASP.NET Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

ASP.NET Tutorials

Reference Sheets

ASP.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month