Creating a Calendar

I need to make a calendar which is to be used in an ASP page.
I wat to know if :
1) I can use a Java Applet which displays the calendar alongwith my ASP page and if yes how do I pass information between the two??
&
2) If I want to create the calendar as a separate ASP page...can anyone get me the logic.

Thanx
venky1981Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

aamironlineCommented:
hi,

       to create a calender for asp. the best way is to use javascript and dhtml. you can use java applet also but why do make page heavy by creating heavy java applets.

logic is as follows



- find the current year : year
- find the current month : month
- create the function to get the total no of days in the current month:daysInMonth()
- create a function getMonthByName() which wil return month name for month number.
- create a function dateClicked that will handle date clicked event
 - create function nextMonth() and prevMonth() which will set the current month.
- after getting all this data you are ready to draw calender.
- set ID of the body as doc
- web calender is nothing but its a normal html table

start creating table as following

/////////////////////////////////////////////////////


var firstDate = new Date(year, month - 1,1);
var firstDay = firstDate.getDay();
var bStart = false;

var row = 6;
var col = 7;
var HTML = "";
     
///////////// Calender Heading
HTML += "<table border='0' style='border-collapse: collapse; border:1 solid #a9a9a9; ' bordercolor='#111111' width='150' height='125' bgcolor='white'>"

HTML += "<tr >"
HTML += "<td id='ArrowLeft' align=center height=10 style='border-bottom:1 solid #a9a9a9; background:#c0c0c0' width='17'><font face='Marlett' size='3'><a  href='#' onclick='prevMonth();return false' class='Arrow' onmouseMove='status=\"Previous Month\"'>3</a></font></td>"

HTML += "<td colspan=5 align=center height=10 style='border-bottom:1 solid #a9a9a9; background:#c0c0c0'>" + getMonthByName() + "</td>"

HTML += "<td align=center height=10 style='border-bottom:1 solid #a9a9a9; background:#c0c0c0' width='22'><font face='Marlett' size='3'><a href='#' class='Arrow' onclick='nextMonth();return false' onmouseMove='status=\"Next Month\"' >4</a></font></td>"

HTML += "</tr>"
     

    ////////////// Days Notations
    HTML += "<tr> "
    HTML += "<td width='17' height='10' bgcolor='#FFFFFF' class='daynotation'>S</td>"
   
    HTML += "<td width='17' height='10' bgcolor='#FFFFFF' class='daynotation'>M</td>"

    HTML += "<td width='16' height='10' bgcolor='#FFFFFF' class='daynotation'>T</td>"
   
    HTML += "<td width='16' height='10' bgcolor='#FFFFFF' class='daynotation'>W</td>"

    HTML += "<td width='16' height='10' bgcolor='#FFFFFF' class='daynotation'>T</td>"
    HTML += "<td width='16' height='10' bgcolor='#FFFFFF' class='daynotation'>F</td>"

    HTML += "<td width='22' height='10' bgcolor='#FFFFFF' class='daynotation'>S</td>"
     HTML += "</tr>"
     //////////////////// Calendar Calcuation Start ////////////////

     var counter = 0;
     
     for (row=0; row<6; row++)
     {
          HTML += "<tr>"
          for(col=0; col<7; col++)
          {
               if (firstDay == col && bStart == false)
                    bStart = true;

               if (bStart == false)
                    HTML += "<td>&nbsp;</td>";
               else
               {
                    ++counter;
                    HTML += "<td ><a class='date' href='#' onmousemove='status=\"" + getMonthByName(month) + " " + counter + ", " + year + "\"' onclick='dateClicked(counter); return false;' id='id" + counter + "'>" + counter + "</a></td>";
               }
               if (counter >= daysInMonth())
                    break;
          }
          HTML += "</tr>"
          if (counter >= daysInMonth())
               break;
     }
     HTML += "</table>";
     doc.innerHTML = HTML;


////////////////////////////////////////////////////////

cheers

m aamir maniar


         
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CleanupPingCommented:
venky1981:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.