We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Asp.Net 2.0 popup calendar

Thread ID:

Created:

Updated:

Platform:

Replies:

43709 May 1,2006 02:29 PM Feb 2,2008 11:35 PM ASP.NET Web Forms (Classic) 5
loading
Tags: FAQ
Amb
Asked On May 1, 2006 02:29 PM

I was trying to generate a popup calendar(same as DateTimePicker control in vb.net) in Asp.net2.0. But I was not able to populate date from popup calendar window into the main form. I kept getting the error Microsoft JScript runtime error: 'window.opener.document.forms.0.StartDateTextBox' is null or not an object Can anyone please correct the error in the following code. Any help would be greatly appreciated. I am using the following code. Main form -------------- <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="default.aspx.vb" Inherits="default" title="Untitled Page" %>
date
--------------------------- DatTimePicker.aspx ---------------------------- <%@ Page Language="VB" AutoEventWireup="false" CodeFile="DatTimePicker.aspx.vb" Inherits="DatTimePicker" %> Calendar
---------------------------------------------------- DatTimePicker.aspx.vb ---------------------------------- Imports System.Web.UI.HtmlControls.HtmlGenericControl Partial Class DatTimePicker Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load control.Value = Request.QueryString("textbox").ToString() End Sub Protected Sub calDate_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles calDate.SelectionChanged Dim strScript As String = "" If (Not Page.ClientScript.IsClientScriptBlockRegistered(Me.GetType(), "DateTimeScript")) Then Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "DateTimeScript", strScript) End If End Sub End Class Thanks.

Poornima
Replied On June 8, 2006 02:51 AM

Hi , use the following code In MainPage.aspx In DatePicker.aspx DatePicker
In DatePicker.vb file Private Sub DatePicker_DayRender(ByVal sender As Object, _ ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles _ Dim hl As New HyperLink() hl.Text = CType(e.Cell.Controls(0), LiteralControl).Text hl.NavigateUrl = "javascript:SetDate(''" & e.Day.Date.ToShortDateString() & "'');" e.Cell.Controls.Clear() e.Cell.Controls.Add(hl) End Sub Thanx

Administrator [Syncfusion]
Replied On June 14, 2006 07:52 AM

> >I was trying to generate a popup calendar(same as DateTimePicker control in vb.net) in Asp.net2.0. But I was not able to populate date from popup calendar window into the main form. > >I kept getting the error > >Microsoft JScript runtime error: 'window.opener.document.forms.0.StartDateTextBox' is null or not an object > > >Can anyone please correct the error in the following code. > >Any help would be greatly appreciated. > >I am using the following code. > >Main form >-------------- > ><%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="default.aspx.vb" Inherits="default" title="Untitled Page" %> > > > > > > > >
> > > >date >
>
> >--------------------------- > >DatTimePicker.aspx >---------------------------- > ><%@ Page Language="VB" AutoEventWireup="false" CodeFile="DatTimePicker.aspx.vb" Inherits="DatTimePicker" %> > > > > > > Calendar > > >
> NextPrevFormat ="ShortMonth" /> > > > > >---------------------------------------------------- > >DatTimePicker.aspx.vb >---------------------------------- > >Imports System.Web.UI.HtmlControls.HtmlGenericControl > >Partial Class DatTimePicker > Inherits System.Web.UI.Page > > Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load > control.Value = Request.QueryString("textbox").ToString() > End Sub > > Protected Sub calDate_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles calDate.SelectionChanged > Dim strScript As String = "" > > If (Not Page.ClientScript.IsClientScriptBlockRegistered(Me.GetType(), "DateTimeScript")) Then > > Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "DateTimeScript", strScript) > End If > End Sub >End Class > >Thanks.

Administrator [Syncfusion]
Replied On June 21, 2006 04:12 AM

I want to add DateTimePicker Control to my aspx page in .Net 2005 . But its toll box is not enable. Can you tell my how to add DateTimePicker in Asp.net 2.0. It ask for some type Dilog Editor, Can guide me how to add DateTimePicker . Jayul

Administrator [Syncfusion]
Replied On September 1, 2006 06:33 AM



>
>I was trying to generate a popup calendar(same as DateTimePicker control in vb.net) in Asp.net2.0. But I was not able to populate date from popup calendar window into the main form.
>
>I kept getting the error
>
>Microsoft JScript runtime error: ''window.opener.document.forms.0.StartDateTextBox'' is null or not an object
>
>
>Can anyone please correct the error in the following code.
>
>Any help would be greatly appreciated.
>
>I am using the following code.
>
>Main form
>--------------
>
><%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="default.aspx.vb" Inherits="default" title="Untitled Page" %>
>
>
>
>
>
>
>
>

>
>

>
>date

>

>

>
>---------------------------
>
>DatTimePicker.aspx
>----------------------------
>
><%@ Page Language="VB" AutoEventWireup="false" CodeFile="DatTimePicker.aspx.vb" Inherits="DatTimePicker" %>
>
>
>
>
>
> Calendar
>
>
>

>> NextPrevFormat ="ShortMonth" />
>
>
>
>
>----------------------------------------------------
>
>DatTimePicker.aspx.vb
>----------------------------------
>
>Imports System.Web.UI.HtmlControls.HtmlGenericControl
>
>Partial Class DatTimePicker
> Inherits System.Web.UI.Page
>
> Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
> control.Value = Request.QueryString("textbox").ToString()
> End Sub
>
> Protected Sub calDate_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles calDate.SelectionChanged
> Dim strScript As String = ""
>
> If (Not Page.ClientScript.IsClientScriptBlockRegistered(Me.GetType(), "DateTimeScript")) Then
>
> Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "DateTimeScript", strScript)
> End If
> End Sub
>End Class
>
>Thanks.

lol
Replied On February 2, 2008 11:35 PM



>Hi ,
> use the following code
>
>In MainPage.aspx
>
>
>
>
>
>
>In DatePicker.aspx
>
>
>
>
> DatePicker
>
>
> > marginwidth="0" marginheight="0">
>

> > />
>
>
>
>
>In DatePicker.vb file
>
>Private Sub DatePicker_DayRender(ByVal sender As Object, _
> ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles _
>
> Dim hl As New HyperLink()
> hl.Text = CType(e.Cell.Controls(0), LiteralControl).Text
> hl.NavigateUrl = "javascript:SetDate('" & e.Day.Date.ToShortDateString() & "');"
> e.Cell.Controls.Clear()
> e.Cell.Controls.Add(hl)
>End Sub
>
>Thanx



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;