Problem with Date Picker
-
Here is the situation I have a web page where I use the following code for prepopulate dates into two text boxes(in Page_Load event), If Not IsPostBack Then Me.DateFromTextBox.Text = System.DateTime.Now.AddDays(-15).ToShortDateString Me.DateToTextBox.Text = System.DateTime.Now.ToShortDateString End If Now I have a date picker icon next to each text box and the user selects the date by clicking the icon(another aspx page opens, usual java script date picker stuff), [
](javascript:; "Pick Date from Calendar") function calendarPicker(strField) { window.open('DatePicker.aspx?field=' + strField, 'calendarPopup', 'width=250,height=250,resizable=no'); } Now I am not able to capture these values selected using datepicker, If the user enters the date without selecting from datpicker I am able to capture the values properly, No matter what I do I am not able to capture the dates picked using date picker, am I missing anything here Thanks in advance, Appreciate any help Sri
-
Here is the situation I have a web page where I use the following code for prepopulate dates into two text boxes(in Page_Load event), If Not IsPostBack Then Me.DateFromTextBox.Text = System.DateTime.Now.AddDays(-15).ToShortDateString Me.DateToTextBox.Text = System.DateTime.Now.ToShortDateString End If Now I have a date picker icon next to each text box and the user selects the date by clicking the icon(another aspx page opens, usual java script date picker stuff), [
](javascript:; "Pick Date from Calendar") function calendarPicker(strField) { window.open('DatePicker.aspx?field=' + strField, 'calendarPopup', 'width=250,height=250,resizable=no'); } Now I am not able to capture these values selected using datepicker, If the user enters the date without selecting from datpicker I am able to capture the values properly, No matter what I do I am not able to capture the dates picked using date picker, am I missing anything here Thanks in advance, Appreciate any help Sri
I don't know how to get values from another page. However, instead of another page, you might want to check out AJAX calendar extender at www.asp.net/ajax. I just added it to my page, and it works well.:)
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..." "There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
-
Here is the situation I have a web page where I use the following code for prepopulate dates into two text boxes(in Page_Load event), If Not IsPostBack Then Me.DateFromTextBox.Text = System.DateTime.Now.AddDays(-15).ToShortDateString Me.DateToTextBox.Text = System.DateTime.Now.ToShortDateString End If Now I have a date picker icon next to each text box and the user selects the date by clicking the icon(another aspx page opens, usual java script date picker stuff), [
](javascript:; "Pick Date from Calendar") function calendarPicker(strField) { window.open('DatePicker.aspx?field=' + strField, 'calendarPopup', 'width=250,height=250,resizable=no'); } Now I am not able to capture these values selected using datepicker, If the user enters the date without selecting from datpicker I am able to capture the values properly, No matter what I do I am not able to capture the dates picked using date picker, am I missing anything here Thanks in advance, Appreciate any help Sri
Try it without the readonly="true" property of the textboxes and see if that works...
-
Here is the situation I have a web page where I use the following code for prepopulate dates into two text boxes(in Page_Load event), If Not IsPostBack Then Me.DateFromTextBox.Text = System.DateTime.Now.AddDays(-15).ToShortDateString Me.DateToTextBox.Text = System.DateTime.Now.ToShortDateString End If Now I have a date picker icon next to each text box and the user selects the date by clicking the icon(another aspx page opens, usual java script date picker stuff), [
](javascript:; "Pick Date from Calendar") function calendarPicker(strField) { window.open('DatePicker.aspx?field=' + strField, 'calendarPopup', 'width=250,height=250,resizable=no'); } Now I am not able to capture these values selected using datepicker, If the user enters the date without selecting from datpicker I am able to capture the values properly, No matter what I do I am not able to capture the dates picked using date picker, am I missing anything here Thanks in advance, Appreciate any help Sri
Hi, Which version are you using? If you are using .net 2.0 then probably you may use CalenderControl which comes with .Net. That serves your purpose I feel. But the thing is the control do not pops up in a different window, instead it gets visible in the same page. Its really good control with lot of readymade functionality. hope this works for you. Regards, Rakesh
Rakesh