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. Returning value to the main page from the popup page

Returning value to the main page from the popup page

Scheduled Pinned Locked Moved ASP.NET
question
5 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.
  • B Offline
    B Offline
    Ballita
    wrote on last edited by
    #1

    Hi, I have a textbox in the main page and a image control. Onclicking on the image one popup window is opening where there is a calendar control. On double clicking on the date it should come in the textbox of the main page. How can i do that.

    Thanks & Regards Mishra

    V I 2 Replies Last reply
    0
    • B Ballita

      Hi, I have a textbox in the main page and a image control. Onclicking on the image one popup window is opening where there is a calendar control. On double clicking on the date it should come in the textbox of the main page. How can i do that.

      Thanks & Regards Mishra

      V Offline
      V Offline
      varshavmane
      wrote on last edited by
      #2

      Use javascript function: On calender Selection changed do this control.Value = calDate.SelectedDate.ToShortDateString(); Response.Write("window.returnValue='" + calDate.SelectedDate.ToString("dd/MM/yyyy") + "';window.close();");

      1 Reply Last reply
      0
      • B Ballita

        Hi, I have a textbox in the main page and a image control. Onclicking on the image one popup window is opening where there is a calendar control. On double clicking on the date it should come in the textbox of the main page. How can i do that.

        Thanks & Regards Mishra

        I Offline
        I Offline
        Imran Khan Pathan
        wrote on last edited by
        #3

        PASS TEXT BOX ID TO POPUP WINDOW. Function calendar(ID) { window.open("calendar.aspx?ID="+ID,......,.......,........); } NOW IN CALENDAR.ASPX.CS PAGE,WRITE BELOVE CODE TO GET SELECTED DATE ON SELECTIONCHANGED EVENT protected void Calendar1_SelectionChanged(object sender, EventArgs e) { Response.Write("opener.document.getElementById('"+Request.Qeurystring["ID"]+"').value='" + Calendar1.SelectedDate.ToShortDateString() + "'; self.close();"); } yOU WILL GET SELECTED DATE IN TEXTBOX. PLZ VOTE IF THIS POST WILL BE HELPFUL bEST rEGARD pATHAN

        ---------------------------------------------------

        B P 2 Replies Last reply
        0
        • I Imran Khan Pathan

          PASS TEXT BOX ID TO POPUP WINDOW. Function calendar(ID) { window.open("calendar.aspx?ID="+ID,......,.......,........); } NOW IN CALENDAR.ASPX.CS PAGE,WRITE BELOVE CODE TO GET SELECTED DATE ON SELECTIONCHANGED EVENT protected void Calendar1_SelectionChanged(object sender, EventArgs e) { Response.Write("opener.document.getElementById('"+Request.Qeurystring["ID"]+"').value='" + Calendar1.SelectedDate.ToShortDateString() + "'; self.close();"); } yOU WILL GET SELECTED DATE IN TEXTBOX. PLZ VOTE IF THIS POST WILL BE HELPFUL bEST rEGARD pATHAN

          ---------------------------------------------------

          B Offline
          B Offline
          Ballita
          wrote on last edited by
          #4

          Thank you very much, Its working fine.

          Thanks & Regards Mishra

          1 Reply Last reply
          0
          • I Imran Khan Pathan

            PASS TEXT BOX ID TO POPUP WINDOW. Function calendar(ID) { window.open("calendar.aspx?ID="+ID,......,.......,........); } NOW IN CALENDAR.ASPX.CS PAGE,WRITE BELOVE CODE TO GET SELECTED DATE ON SELECTIONCHANGED EVENT protected void Calendar1_SelectionChanged(object sender, EventArgs e) { Response.Write("opener.document.getElementById('"+Request.Qeurystring["ID"]+"').value='" + Calendar1.SelectedDate.ToShortDateString() + "'; self.close();"); } yOU WILL GET SELECTED DATE IN TEXTBOX. PLZ VOTE IF THIS POST WILL BE HELPFUL bEST rEGARD pATHAN

            ---------------------------------------------------

            P Offline
            P Offline
            pmarfleet
            wrote on last edited by
            #5

            Imran Khan Pathan wrote:

            Response.Write("opener.document.getElementById('"+Request.Qeurystring["ID"]+"').value='" + Calendar1.SelectedDate.ToShortDateString() + "'; self.close();");

            It isn't good practice to use Response.Write to inject Javascrip code into your ASP.NET web page. Use the functionality exposed by the Page.ClientScript object. Regards Paul

            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