Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Problem with Date Picker

Problem with Date Picker

Scheduled Pinned Locked Moved ASP.NET
helpjavajavascripttoolsquestion
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    talasila80
    wrote on last edited by
    #1

    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),  [Pick](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

    R F R 3 Replies Last reply
    0
    • T talasila80

      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),  [Pick](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

      R Offline
      R Offline
      Richard Jones
      wrote on last edited by
      #2

      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..."

      1 Reply Last reply
      0
      • T talasila80

        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),  [Pick](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

        F Offline
        F Offline
        Fred_Smith
        wrote on last edited by
        #3

        Try it without the readonly="true" property of the textboxes and see if that works...

        1 Reply Last reply
        0
        • T talasila80

          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),  [Pick](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

          R Offline
          R Offline
          rockyl
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups