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,092 people online right now. Registration is fast and FREE... Join Now!





Asp Calendar

Weekly view free for learning

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

Language: ASP

Last Modified: June 25, 2005
Instructions: copy and paste and run with iis

Snippet


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

Copy & Paste


Comments


There are currently no comments for this snippet. Be the first to comment!

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