Solved

500 PONTS!!! Creating a Calendar

Posted on 2006-11-19
4
189 Views
Last Modified: 2012-06-27
How do I remove the underlines from NextPrevStyle and the DayStyle and also how do I preselect todays date (so it's highlighted) on the initial load of the Calendar object?
0
Comment
Question by:ScubeduFan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 12

Expert Comment

by:sandip132
ID: 17976572
Just add this style in your html's <HEAD> tag.
<STYLE type="text/css">
<!--
A { text-decoration:none }
-->
</STYLE>

By default the calender control selects server's todays date.
0
 
LVL 1

Accepted Solution

by:
satyendrastomar earned 500 total points
ID: 17977487
Hi,


  Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not Page.IsPostBack Then
            calDate.SelectedDate = DateTime.Now.ToString
        End If
  End Sub



 Private Sub calDate_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles calDate.DayRender

        '// Clear the link from this day
        e.Cell.Controls.Clear()

        '// Add the custom link
        Dim Link As System.Web.UI.HtmlControls.HtmlGenericControl
        Link = New System.Web.UI.HtmlControls.HtmlGenericControl
        Link.TagName = "a"
        Link.InnerText = e.Day.DayNumberText
        '<p class="speciallink"><
        Link.Attributes.Add("href", String.Format("JavaScript:window.returnValue = '{1:d}'; window.close();", Request.QueryString("field"), Format(e.Day.Date, "dd/MM/yyyy")))
        'Link.Attributes.Add("href", String.Format("JavaScript:window.returnValue = '{1:d}'; window.close();", Request.QueryString("field"), e.Day.Date))

        '// By default, this will highlight today's date.
        If e.Day.IsSelected Then
            Link.Attributes.Add("style", Me.calDate.SelectedDayStyle.ToString())
        End If

        '// Now add our custom link to the page
        e.Cell.Controls.Add(Link)

    End Sub

Write this code in to your code behind u will get a calender control which select today's date as default. also write this script tag in your .aspx page

<STYLE type="text/css">
<!--
A { text-decoration:none }
-->
</STYLE>

Regards,
Satyendra
0
 
LVL 6

Expert Comment

by:Niraj_Singh
ID: 17978900

 Do you want to use the javascript calender or asp.net inbuild calender.
 if you are thinking of using javascript calender then u cal get many calenders and u will just have to include reference in your code.
 
0
 

Author Comment

by:ScubeduFan
ID: 17992612
sandip ... you got the easy part (the CSS), but your answer on the calendar was wrong.

satyendrastomar ... thanks for the code .... this is exactly what I was needed ...

<script Language="VB" Runat="Server">
  Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not Page.IsPostBack Then
            Calendar1.SelectedDate = DateTime.Now.ToString
        End If
  End Sub
</script>
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

626 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