0

i have this code in aspx page

<div id=date_check visible=true runat=server>
          <strong>Check-In Date</strong> <asp:TextBox  ID="txt_checkin"  runat="server" onchange="checkdate(this);"></asp:TextBox>
<a  href="javascript:calendar_window=window.open('calendar.aspx?form1=form1.txt_checkin','calendar_window','width=554,height=488');calendar_window.focus()">
<img alt=""  src="images/calendar.png"    />  
        </a> 
              
  <strong>Check-Out Date</strong> <asp:TextBox  ID="txt_checkout"  runat="server" onchange="checkdate(this);"></asp:TextBox>
<a href="javascript:calendar_window=window.open('calendar.aspx?form1=form1.txt_checkout','calendar_window','width=554,height=488');calendar_window.focus()">
<img  alt=""  src="images/calendar.png"   />  
        </a>  
     
         </div>
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="calendar.aspx.vb" Inherits="gfln1.calendar_aspx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
     <script runat="server">
    Protected Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar1.DayRender 
                  If e.Day.Date < DateTime.Today.Date Then 
                             e.Cell.Enabled = False        
                             e.Cell.ToolTip = "This date is not available"                      
                 End If 
    End Sub

Private Sub Calendar1_SelectionChanged(sender As Object, e As EventArgs)
    Dim strjscript As String = "<script language=""javascript"">"
    
        strjscript &= "window.opener." & _
              HttpContext.Current.Request.QueryString("form1") & ".value = '" & Calendar1.SelectedDate & "';window.close();"
        strjscript = strjscript & "</script" & ">" 'Don't Ask, Tool Bug

        Literal1.Text = strjscript  'Set the literal control's text to the JScript code

End Sub

</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     <asp:Calendar id="Calendar1" runat="server" 
                     OnSelectionChanged="Calendar1_SelectionChanged" 
                    
                     ShowTitle="true" DayNameFormat="FirstTwoLetters" 
                     SelectionMode="Day" BackColor="#ffffff" 
                     FirstDayOfWeek="Monday" BorderColor="#000000" 
                     ForeColor="#00000" Height="60" Width="120">
        <TitleStyle backcolor="#000080" forecolor="#ffffff" />
        <NextPrevStyle backcolor="#000080" forecolor="#ffffff" />
        <OtherMonthDayStyle forecolor="#c0c0c0" />
    </asp:Calendar>
    <asp:Literal id="Literal1" runat="server"></asp:Literal>
</div>
    </form>
</body>
</html>

but it showing old dates in FF but not in IE ,i wanted to disable old dates when open calender ..any work around

1
Contributor
2
Replies
3
Views
6 Years
Discussion Span
Last Post by erum
0

my latest code is like this

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="calendar.aspx.vb" Inherits="gfln1.calendar_aspx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
     <script runat="server">
    Protected Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar1.DayRender 
                  If e.Day.Date < DateTime.Today.Date Then 
                             e.Cell.Enabled = False        
                             e.Cell.ToolTip = "This date is not available"                      
                 End If 
    End Sub

Private Sub Calendar1_SelectionChanged(sender As Object, e As EventArgs)
    Dim strjscript As String = "<script language=""javascript"">"
    
        strjscript &= "window.opener." & _
              HttpContext.Current.Request.QueryString("form1") & ".value = '" & Calendar1.SelectedDate & "';window.close();"
        strjscript = strjscript & "</script" & ">" 'Don't Ask, Tool Bug

        Literal1.Text = strjscript  'Set the literal control's text to the JScript code

End Sub

</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     <asp:Calendar id="Calendar1" runat="server" 
                     OnSelectionChanged="Calendar1_SelectionChanged" 
                    
                     ShowTitle="true" DayNameFormat="FirstTwoLetters" 
                     SelectionMode="Day" BackColor="#ffffff" 
                     FirstDayOfWeek="Monday" BorderColor="#000000" 
                     ForeColor="#00000" Height="60" Width="120">
        <TitleStyle backcolor="#000080" forecolor="#ffffff" />
        <NextPrevStyle backcolor="#000080" forecolor="#ffffff" />
        <OtherMonthDayStyle forecolor="#c0c0c0" />
    </asp:Calendar>
    <asp:Literal id="Literal1" runat="server"></asp:Literal>
</div>
    </form>
</body>
</html>

and here is another chunk of code

<div id=date_check visible=true runat=server>
          <strong>Check-In Date</strong> <asp:TextBox  ID="txt_checkin"  runat="server" onchange="checkdate(this);"></asp:TextBox>
<a  href="javascript:calendar_window=window.open('calendar.aspx?form1=form1.txt_checkin','calendar_window','width=554,height=488');calendar_window.focus()">
<img alt=""  src="images/calendar.png"    />  
        </a> 
              
  <strong>Check-Out Date</strong> <asp:TextBox  ID="txt_checkout"  runat="server" onchange="checkdate(this);"></asp:TextBox>
<a href="javascript:calendar_window=window.open('calendar.aspx?form1=form1.txt_checkout','calendar_window','width=554,height=488');calendar_window.focus()">
<img  alt=""  src="images/calendar.png"   />  
        </a>  
     
         </div>
0
Public Partial Class calendar_aspx
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub
    'Private Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As EventArgs)
    '    End Sub


    Private Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Calendar1.SelectionChanged
        Dim strjscript As String = "<script language=""javascript"">"
        strjscript &= "window.opener." & _
              HttpContext.Current.Request.QueryString("form1") & ".value = '" & _
              Calendar1.SelectedDate & "';window.close();"
        strjscript = strjscript & "</script" & ">" 'Don't Ask, Tool Bug

        Literal1.Text = strjscript  'Set the literal control's text to the JScript code

    End Sub
End Class

i want that it need to show current and above it dates and hide old one..this is working fine in IE but not in FF.any help

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.