Connecting Tech Pros Worldwide Forums | Help | Site Map

Popup calendar

Ali
Guest
 
Posts: n/a
#1: Nov 19 '05
I am trying to create a popup calender so when a user click on a image on
the main form, a calender will then popup, the user will select a date and
the date will then be passed back to the main form and populate a textbox. it
works fine. but when i use it within a table cell everything worked properly
except populating the textbox with the selected date?? any suggestions will
be highly appreciated.

here's the code which popups the calendar:
<div>
<asp:textbox id=txtDate runat="server" ForeColor="Black" Width="88px">
</asp:textbox><A
onclick="window.open('Calendar.aspx?textbox=txtDat e','cal','width=300,height=300,left=470,top=300')"
href="javascript:;"><IMG src="images/SmallCalendar.gif" border="0">
</A>

</div>

and here's the code for the selection change:

Private Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Calendar1.SelectionChanged
Dim strjscript As String = "<script language=""javascript"">"
strjscript &= "window.opener." & _
HttpContext.Current.Request.QueryString("formname" ) & ".value
= '" & _
Calendar1.SelectedDate & "';window.close();"
strjscript = strjscript & "</scr" & "ipt>"
Literal1.Text = strjscript
End Sub

Ali
Guest
 
Posts: n/a
#2: Nov 19 '05

re: Popup calendar


I found out the cause of my problem but i really don't know how to fix it.
The thing is I am using Master Page for all my pages ( Visual Studio 2005 ).
I tried it without the Masterpage it works fine. But when i tried it using
master page it didn't work. any help will be highly appreciated




"Ali" wrote:
[color=blue]
> I am trying to create a popup calender so when a user click on a image on
> the main form, a calender will then popup, the user will select a date and
> the date will then be passed back to the main form and populate a textbox. it
> works fine. but when i use it within a table cell everything worked properly
> except populating the textbox with the selected date?? any suggestions will
> be highly appreciated.
>
> here's the code which popups the calendar:
> <div>
> <asp:textbox id=txtDate runat="server" ForeColor="Black" Width="88px">
> </asp:textbox><A
> onclick="window.open('Calendar.aspx?textbox=txtDat e','cal','width=300,height=300,left=470,top=300')"
> href="javascript:;"><IMG src="images/SmallCalendar.gif" border="0">
> </A>
>
> </div>
>
> and here's the code for the selection change:
>
> Private Sub Calendar1_SelectionChanged(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles Calendar1.SelectionChanged
> Dim strjscript As String = "<script language=""javascript"">"
> strjscript &= "window.opener." & _
> HttpContext.Current.Request.QueryString("formname" ) & ".value
> = '" & _
> Calendar1.SelectedDate & "';window.close();"
> strjscript = strjscript & "</scr" & "ipt>"
> Literal1.Text = strjscript
> End Sub[/color]
Closed Thread