When using the Calendar Popup in a content page of a masterpage the strForName is always set to aspnetForm
This breaks this line from working properly
window.opener.document.forms["<%= strFormName %>"]......
How can I fix this and display the date into textbox after selecting the date from Calendar.aspx? This Very Urgent ..........................
If any body help me out
I have given the following Code
******************************
Code For :Master.master
******************************
-
<%@ Master Language="VB" CodeFile="Master.master.vb" Inherits="Pages_Master" %>
-
-
<!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">
-
</head>
-
<body>
-
<h1>Standard Header For All Pages</h1>
-
<asp:ContentPlaceHolder id="CPH1" runat="server">
-
-
</asp:ContentPlaceHolder>
-
</body>
-
</html>
-
**************************************
Code For :PopUpCalendar.aspx
**************************************
This is a Cotent Page
--------------------------------
-
<%@ Page Language="VB" MasterPageFile="Master.master" %>
-
-
<script runat="server">
-
-
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
-
-
End Sub
-
</script>
-
-
<asp:Content ID="Content1" ContentPlaceHolderId="CPH1" runat="server">
-
<script type="text/javascript" language="Javascript">
-
function GetDate(CtrlName)
-
{/************ Use Javascript method (window.open) to PopUp a new window
-
which contain a Calendar Control. In the meantime, we'll
-
pass the Parent Form Name and Request Control Name in the QueryString!
-
******************/
-
ChildWindow = window.open('Calendar.aspx?FormName=' + document.forms[0].name + '&CtrlName='
-
+ CtrlName , "PopUpCalendar",
-
"width=270,height=270,top=200,left=200,toolbars=no,scrollbars=no,status=no,resizable=no");
-
}
-
function CheckWindow()
-
{ ChildWindow.close(); }
-
</script>
-
<form id="Parent" runat="server">
-
Start Date:
-
<asp:TextBox id="txtStartDate" runat="server"></asp:TextBox>
-
<%-- Pass in the Request Control Name, e.g. txtStartDate, into the Javascript method --%>
-
<a href="javascript:GetDate('txtStartDate')">Select Date</a>
-
<br />
-
End Date:<asp:TextBox id="txtEndDate" runat="server"></asp:TextBox>
-
<a href="javascript:GetDate('txtEndDate')">Select Date</a>
-
</form>
-
</asp:Content>
-
******************************
Code For :Calendar.aspx
*******************************