By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,361 Members | 1,683 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,361 IT Pros & Developers. It's quick & easy.

Popup calendar

P: n/a
Ali
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
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ali
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:
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

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.