Hello Everyone,
I have made a webform in asp.net 2005 with a calendar control, please see below for code. I have another webpage with hyperlink to popupcalendar page. The problem is the second page has a masterpage and when i click the hyperlink the popupcalendar is displayed but the date selected is not being transferred to the text box in the second page, It works fine if i remove the master page link from the second page, any ideas guys whats happening here.
HTML CODE - Popup Calendar:
<%@ Page Language="vb" AutoEventWireup="false" Inherits="KMAttendance.PopUp" CodeFile="PopUp.aspx.vb" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
Width="220px" DayNameFormat="FirstLetter" ForeColor="#003399" Height="200px" Font-Size="8pt"
Font-Names="Verdana" BorderColor="#3366CC" CellPadding="1">
<SelectorStyle ForeColor="#336666" BackColor="#99CCCC"></SelectorStyle>
<SelectedDayStyle Font-Bold="True" ForeColor="#CCFF99" BackColor="#009999"></SelectedDayStyle>
BorderStyle="Solid" BorderColor="#3366CC" BackColor="#003399">
<input type="hidden" id="control" runat="server" visible="false">
</form>
</body>
</HTML>
VB CODE-popup calendar:
Imports System.Web.UI.HtmlControls.HtmlGenericControl
Namespace KMAttendance
Partial Class PopUp
Inherits System.Web.UI.Page
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'control.Value = Request("textbox")
control.Value = Request.QueryString("textbox")
End Sub
Protected Sub Change_Date(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim strScript As String = "<script>window.opener.document.forms(0)." + Request.QueryString("textbox").ToString() + ".value = '"
'strScript += calDate.SelectedDate.ToString("dd/MM/yyyy")
strScript += calDate.SelectedDate.ToLongDateString
strScript += "';self.close()"
strScript += " RegisterClientScriptBlock("Calendar_ChangeDate", strScript)
'Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "anything", strScript, True)
End Sub
Private Sub InitializeComponent()
End Sub
End Class
End Namespace
HTML Code-Second Webpage
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="NoUpdate.aspx.vb" Inherits="KMAttendance.NoUpdate" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<table border="0" align="Left" cellpadding="0" cellspacing="4" bordercolordark="silver" style="width: 456px; height: 16px">
<tr>
<td align="center" style="height: 19px; width: 61px;">
</td>
<td align="Left" style="height: 19px; width: 103px;">
<table style="width: 286px; height: 57px">
<tr>
<td style="width: 25px; height: 21px;">
</td>
<td style="height: 21px">
</td>
<td style="height: 21px">
</td>
</tr>
<tr>
<td style="width: 25px; height: 21px">
<IMG src="Images/calendar.png" border="0"></td>
<td style="height: 21px">
</td>
<td style="height: 21px">
</td>
</tr>
<tr>
<td style="width: 25px">
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
</td>
</tr>
</table>
Thanks in Advance for your help. Best Regards, Sharon