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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Opening a popup window for data entry in .NET

Opening a popup window for data entry in .NET

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptsysadmintools
4 Posts 3 Posters 12 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
    beacon dartmouth
    wrote on last edited by
    #1

    I have a page with labels, dropdown lists, and buttons, which needs to be always visible in the browser. When the user clicks a 'modify' button on this page, a web form with text boxes will open up in the form of a new popup window, so that changes can be made and submitted from this smaller popup window. Ideally, the main page should be re-loaded in the original browser window reflecting the latest udpates after the popup window is closed. I am passing variables to the popup and the code below doesn't quite behave as I wanted it to. As it is right now, I'm calling the appDetailEdit,aspx twice, but I don't know enough to write an inline javascript statement so that it opens up a popup window, passes the values I need to it, while keeping the main page in the original browser window, which will reload automatically when the form in the popup window is submitted. Thank you. :doh: CODE STARTS Sub bClick1( s As Object, e As EventArgs ) Context.Items.Add( "Application_ID", lblAppID.Text ) Context.Items.Add( "Name", lblName.Text ) Context.Items.Add( "Acronym", lblAcronym.Text ) Context.Items.Add( "Program_Area_Name", lblProgArea.Text ) Context.Items.Add( "Usage_start_Date", lblStartDate.Text ) Context.Items.Add( "Description", lblDesc.Text ) Context.Items.Add( "Field_Detail", lblFieldDet.Text ) Context.Items.Add( "DivisionName", lblDivisionID.Text ) Context.Items.Ad d( "BureauName", lblBureauID.Text ) Response.write("window.open('appDetailEdit.aspx','PopUp','location=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes')<" & "/script>") server.transfer( "appDetailEdit.aspx", true ) End Sub CODE ENDS </x-turndown>

    P 1 Reply Last reply
    0
    • B beacon dartmouth

      I have a page with labels, dropdown lists, and buttons, which needs to be always visible in the browser. When the user clicks a 'modify' button on this page, a web form with text boxes will open up in the form of a new popup window, so that changes can be made and submitted from this smaller popup window. Ideally, the main page should be re-loaded in the original browser window reflecting the latest udpates after the popup window is closed. I am passing variables to the popup and the code below doesn't quite behave as I wanted it to. As it is right now, I'm calling the appDetailEdit,aspx twice, but I don't know enough to write an inline javascript statement so that it opens up a popup window, passes the values I need to it, while keeping the main page in the original browser window, which will reload automatically when the form in the popup window is submitted. Thank you. :doh: CODE STARTS Sub bClick1( s As Object, e As EventArgs ) Context.Items.Add( "Application_ID", lblAppID.Text ) Context.Items.Add( "Name", lblName.Text ) Context.Items.Add( "Acronym", lblAcronym.Text ) Context.Items.Add( "Program_Area_Name", lblProgArea.Text ) Context.Items.Add( "Usage_start_Date", lblStartDate.Text ) Context.Items.Add( "Description", lblDesc.Text ) Context.Items.Add( "Field_Detail", lblFieldDet.Text ) Context.Items.Add( "DivisionName", lblDivisionID.Text ) Context.Items.Ad d( "BureauName", lblBureauID.Text ) Response.write("window.open('appDetailEdit.aspx','PopUp','location=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes')<" & "/script>") server.transfer( "appDetailEdit.aspx", true ) End Sub CODE ENDS </x-turndown>

      P Offline
      P Offline
      payback
      wrote on last edited by
      #2

      Hi, Perhaps this can help u. lbljavascript is the label on the PopUp page in which i wrote all the javascript that access another label on the Parent Page (Window Opener). i wrote a whole HTML table in the Label control of the "Opener page" with that data selected in the dropdown lists of the "Opened Page."(see window.opener.document.Form1.all[""lbldoclist""].innerHTML ) self.close(); closes the child page ///////////////********///////////////////////////// lbljavascript.Text = "" & vbCrLf & "" _ & "<!-- " & vbCrLf & "" _ & "window.opener.document.Form1.all[""lbldoclist""].innerHTML = """ lbljavascript.Text += "<table class='nfnt'>" For i = 0 To lbxAddeddoctors.Items.Count - 1 lbljavascript.Text += "<tr><td>" & i + 1 & "</td>" lbljavascript.Text += "<td>" & lbxAddeddoctors.Items(i).Text & "</td>" & "</tr>" er.EventPlan.Participant.ParticipantDoctors.Add(lbxAddeddoctors.Items(i).Value) Next lbljavascript.Text += "</table>" lbljavascript.Text += """;" & vbCrLf lbljavascript.Text += "self.close(); " lbljavascript.Text += "//-->" & vbCrLf lbljavascript.Text += "" ///////////////********///////////////////////////// PayBack

      A 1 Reply Last reply
      0
      • P payback

        Hi, Perhaps this can help u. lbljavascript is the label on the PopUp page in which i wrote all the javascript that access another label on the Parent Page (Window Opener). i wrote a whole HTML table in the Label control of the "Opener page" with that data selected in the dropdown lists of the "Opened Page."(see window.opener.document.Form1.all[""lbldoclist""].innerHTML ) self.close(); closes the child page ///////////////********///////////////////////////// lbljavascript.Text = "" & vbCrLf & "" _ & "<!-- " & vbCrLf & "" _ & "window.opener.document.Form1.all[""lbldoclist""].innerHTML = """ lbljavascript.Text += "<table class='nfnt'>" For i = 0 To lbxAddeddoctors.Items.Count - 1 lbljavascript.Text += "<tr><td>" & i + 1 & "</td>" lbljavascript.Text += "<td>" & lbxAddeddoctors.Items(i).Text & "</td>" & "</tr>" er.EventPlan.Participant.ParticipantDoctors.Add(lbxAddeddoctors.Items(i).Value) Next lbljavascript.Text += "</table>" lbljavascript.Text += """;" & vbCrLf lbljavascript.Text += "self.close(); " lbljavascript.Text += "//-->" & vbCrLf lbljavascript.Text += "" ///////////////********///////////////////////////// PayBack

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        thanx a million. i'm working on your idea. i see some potential, so i appreciate your posting. b-d

        P 1 Reply Last reply
        0
        • A Anonymous

          thanx a million. i'm working on your idea. i see some potential, so i appreciate your posting. b-d

          P Offline
          P Offline
          payback
          wrote on last edited by
          #4

          Thanx for your appreciation :)

          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