calender in modal window

G

Guest

i have a button that opens a modal window which has the calender control in
it. I allow the user to select a date then that date should be passed back to
the parent form. I'm having an issue with this. When I select a date, i keep
getting a JavaScript error and i debug it and it goes to this line:

__doPostBack('ctlCalender','1781').



i can get this working in VB.NET so i converted the code over and now i get
the error. I need this in C#
 
G

Guest

that didn't work either. I did try it on the same page and it worked. Its
something with either the new window, or the session variable really isn't
being "saved" for some reason
 
G

Guest

the vb.net code: on my modal windowL

page_load
if not isPostBack then
calendar.selectedDate = Date.Now
end if
Session("myDay") = format(calendar.selectedDate, "MM/dd")

sub calendar_selectedChanged
if calendar.selectedMode = CalendarSelectionMode.Day then
Session("myDay") = format(calendar.selectedDate, "MM/dd")
end if
 
C

Curt_C [MVP]

Not fully tested but is this close to what you had?

page_load
if(!IsPostBack)
{
calendar.SelectedDate = Date.Now;
}
Session["myDay"] = Convert.ToDateTime(calendar.SelectedDate).ToShortDate();

sub calendar_selectedChanged
if(calendar.SelectedMode = CalendarSelectionMode.Day)
{
Session["myDay"] =
Convert.ToDateTime(calendar.SelectedDate).ToShortDate();
}


--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,157
Latest member
MercedesE4
Top