Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
misc
exam.security
microsoft_update_catalog
msdn.annotations
msdn.drgui.discussion
msdn.duwamish
msdn.general
msdn.magazine
msdn.soaptoolkit
msdn.webservices
msdntraining
opsmgr.connectors
opsmgr.sp1
technet
technet.howtofeedback
technet.howtoneeds
technet.magazine
technet.technettalks
  
 
date: Mon, 25 Aug 2008 12:53:58 -0700 (PDT),    group: microsoft.public.msdn.general        back       


ASP.NET - Calendar popup - how to return selected date back to parent page (with a master page)   
My page hierarchy is
Master page -> Content page -> User control -> <asp:TextBox
ID="tboxTravelDate> for date and an icon for calendar.

When user clicks on the calendar icon, a calendar pops up (an aspx
page). This page has <asp:Calendar> control. In the code-behind for
this page, I have

Protected Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles Calendar1.SelectionChanged

        Dim js, ElementName As String
        js = "<script language='javascript' type='text/javascript'> "
        ElementName = Request.QueryString("ElementName")    'Evaluates
to 'tboxTravelDate'

        js &=
"{window.opener.document.getElementById('ctl00_CPHLeft_CF1_" &
ElementName & "')" & ".value = '" &
Calendar1.SelectedDate.ToString("MM/dd/yyyy") & "'; window.close(); }"

        js &= "</script>"
        Response.Write(js)

When user clicks on a particular date, the pop up closed (as
expected). The selected date is displayed in the parent page in the
tboxTravelDate.

However, in the code-behind, when I read tboxTravelDate.Text it is an
empty string ("") and tboxTravelDate.Length is zero.

I have ran out of ideas and looking for some help. Any clues why
tboxTravelDate is an empty string and tboxTravelDate.Lenght is zero?

Thank you.
date: Mon, 25 Aug 2008 12:53:58 -0700 (PDT)   author:   unknown

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us