Board Logo

The calendar isn't working since I implemented it within a Content Page which belongs to Master Page in ASP NET.
sergio.ramos - 6/3/2008 at 11:37 PM

This is how my content page looks:

<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="InsertOpenSessions7.aspx.vb" Inherits="InsertOpenSessions7" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<script type ="text/javascript" language="JavaScript" src="calendar2.js"></script>

<form id="form1" runat="server">
<div>
<table width ="400px" cellpadding ="3px" cellspacing="3px" style ="font:Arial; font-size :15px">
<tr>
<td>
<asp:TextBox ID="txtenddate" runat="server" text="12/12/2008" ></asp:TextBox>
<a href="javascript:cal2.popup();" ><img src="img/cal.gif" width="22" height="22" style ="border:0" alt="Click Here to Pick up the date"/></a>
<br />
</td> </tr></table>
</div>
</form>

<script type ="text/javascript" language="javascript">

var cal2 = new calendar2(document.getElementById("<%=txtenddate.ClientID%>").value);
cal2.year_scroll = false;
cal2.time_comp = false;
</script>


</asp:Content>


tigra - 6/4/2008 at 06:51 PM

With the current version you pass the reference to the input element to the calendar's constructor, not its value.
I'm not ASP expert but first thing I'd try would be replacing
var cal2 = new calendar2(document.getElementById("<%=txtenddate.ClientID%>").value);
with
var cal2 = new calendar2(document.getElementById("<%=txtenddate.ClientID%>"));


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/