Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

how do we initialize the calendar control with certain date?

Posted on 2011-03-08
4
Medium Priority
?
801 Views
Last Modified: 2012-05-11
1- like If the user click the text boxt to change, after first time,  I want the same month year appears.
2- I tried width and height but the calendar control did not went below 16px? How can I make the calendar picker very small with small fonts?
I am using asp.net
thanks

<%@ Page Language="C#" AutoEventWireup="True" %>
<html>
<head>

   <script language="C#" runat="server">

      void Selection_Change(Object sender, EventArgs e)
      {
         Label1.Text = "The selected date is " + Calendar1.SelectedDate.ToShortDateString();
      }

   </script>

</head>    
<body>

   <form runat="server">

      <h3>Calendar Example</h3>

      Select a date on the Calendar control.<br><br>

      <asp:Calendar ID="Calendar1" runat="server"  
           SelectionMode="Day"
           ShowGridLines="True"
           OnSelectionChanged="Selection_Change">
 
         <SelectedDayStyle BackColor="Yellow"
                           ForeColor="Red">
         </SelectedDayStyle>
     
      </asp:Calendar>    

      <hr><br>

      <asp:Label id="Label1" runat=server />

   </form>
</body>
</html>
0
Comment
Question by:goodk
  • 3
4 Comments
 
LVL 5

Accepted Solution

by:
jijeesh earned 1500 total points
ID: 35074536
You can set the property of font of calendar control as you required.

<asp:Calendar ID="Calendar1" runat="server"  
           SelectionMode="Day" 
           ShowGridLines="True"
           OnSelectionChanged="Selection_Change" Font-Bold="True" Font-Size="5pt">
 
         <SelectedDayStyle BackColor="Yellow"
                           ForeColor="Red">
         </SelectedDayStyle>
      
      </asp:Calendar>

Open in new window

0
 

Author Comment

by:goodk
ID: 35075056
and how do we initialize the calendar to a particular date/month? like I want it to have August 2000 when the calendar appear?
0
 

Author Comment

by:goodk
ID: 35075122
Label1.Text = "The selected date is " + Calendar1.SelectedDate.ToShortDateString();

just the reverse of the above.  Like the calendar1.??=Label1.Text;
0
 

Author Closing Comment

by:goodk
ID: 35096710
partial answer
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question